在 Tailwind css 中用文本圈

trz*_*zew 4 css tailwind-css

我是初学者网络开发人员。我有 Tailwind CSS 的小问题。我需要这个:https : //ibb.co/KL8cDR2

这是我的代码:

<div class="w-1/2 h-10 rounded-full bg-gray-400" style="background-color:red">404</div>
Run Code Online (Sandbox Code Playgroud)

但它不起作用:(我该怎么做?请帮帮我

Vir*_*ngh 9

位置绝对方式:

<div class="rounded-full border-2 flex p-3 relative">
    <div class="absolute top-5 left-8">
        4
     </div>
</div>
Run Code Online (Sandbox Code Playgroud)

在 tailwind.config.js 中扩展插入

theme: {
  inset: {
     '5': '5px',
     '8': '8px'
   }
}
Run Code Online (Sandbox Code Playgroud)

弹性方式:

 <div class="w-20 h-20 rounded-full flex justify-center items-center">
       <p>404</p>
 </div>
Run Code Online (Sandbox Code Playgroud)

<div class="rounded-full border-2 flex p-3 relative">
    <div class="absolute top-5 left-8">
        4
     </div>
</div>
Run Code Online (Sandbox Code Playgroud)


小智 8

 <div class="font-bold text-gray-700 rounded-full bg-white flex items-center justify-center font-mono" style="height: 500px; width: 500px; font-size: 170px;">404</div>
Run Code Online (Sandbox Code Playgroud)

这应该可以完成工作。确保添加一个自定义类,它定义了圆的高度和宽度以及字体大小,并font-mono从类中删除并添加您想要的字体。