Tailwind CSS Font Weight ClassesBelow is a list of Tailwind CSS classes that specify different font weights to control the thickness and boldness of text.ClassProperties font-thin font-weight: 100; font-extrali
italic 即 font-style: italic; font-thin 即 font-weight: 100; font-light 即 font-weight: 300; font-normal 即 font-weight: 400; font-bold 即 font-weight: 700; font-black 即 font-weight: 900;6. 颜色 透明 渐变<p className="text-red-500">islandZzz -- 文本颜色</p> <p className="...
font-size: 2rem; } } @layer components { btn-blue { @apply bg-blue-500 px-4 py-2 rounded-xl font-bold hover:bg-blue-700; } } @config:用于指定 Tailwind 在编译该 CSS 文件时应使用的配置文件 @config "./tailwind.input.config.js"; b. 函数 函数用于访问 Tailwind 中的特定值,构建后会...
@font-face 规则 您可以使用相同的方式为您正在使用的任何自定义字体添加@font-face规则。 @tailwindbase;@tailwindcomponents;@tailwindutilities;@layerbase{@font-face{font-family:Proxima Nova;font-weight:400;src:url(/fonts/proxima-nova/400-regular.woff)format("woff");}@font-face{font-family:Proxima ...
// tailwind.config.js const plugin = require('tailwindcss/plugin') module.exports = { plugins: [ plugin(function({ addComponents }) { const buttons = { '.btn': { padding: '.5rem 1rem', borderRadius: '.25rem', fontWeight: '600', }, '.btn-blue': { backgroundColor: '#3490dc'...
<link href="/dist/output.css"rel="stylesheet"> </head> <body> <h1class="text-3xl font-bold text-center mt-4">Welcome to Tailwind CSS!</h1> </body> </html> 创建CSS: npx tailwindcss -i ./src/input.css -o ./src/output.css --watch ...
有9 种不同的字体大小和相当多的颜色的Utilize Class,因此你可以通过仅更新 html 文件进行设计,而无需编写自己的 css 样式。 如果你想使用未在 Tailwind CSS 的Utilize Class中注册的颜色,你可能想知道该怎么做。在这种情况下,你可以通过在 Tailwind CSS配置文件中注册它,以与其他 Tailwind CSSUtilize Class相同的...
font-{weight}:font-bold(加粗)、font-medium(中等粗细)等。在强调文本重点时: <p class="text-gray-700">这段内容中有 <span class="font-bold">重要信息</span> 需注意。</p> 文字颜色 text-{color}:结合颜色系统,如text-gray-800(深灰色文字)、text-green-500(绿色文字)。用于提示信息: <p clas...
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; } 列表默认无样式 代码语言:javascript 代码运行次数:0 运行 AI代码解释 ol, ul { list-style: none; margin: 0; padding: 0; } 多媒体元素块级化。 浏览器默认设置这些多媒体元素的 display 为inline,Tailwind CSS 将其默认设...
font - [weight]:设置字体粗细,如font - bold。 italic:设置字体为斜体。 背景与边框 bg - [color]:设置背景颜色,如bg - gray - 100。 border - [width]:设置边框宽度,如border - 2。 border - [color]:设置边框颜色,如border - red - 400。