W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
用于控制元素邊框半徑的功能類。
Class
|
Properties
|
---|---|
rounded-none | border-radius: 0px; |
rounded-sm | border-radius: 0.125rem; |
rounded | border-radius: 0.25rem; |
rounded-md | border-radius: 0.375rem; |
rounded-lg | border-radius: 0.5rem; |
rounded-xl | border-radius: 0.75rem; |
rounded-2xl | border-radius: 1rem; |
rounded-3xl | border-radius: 1.5rem; |
rounded-full | border-radius: 9999px; |
rounded-t-none | border-top-left-radius: 0px; border-top-right-radius: 0px; |
rounded-t-sm | border-top-left-radius: 0.125rem; border-top-right-radius: 0.125rem; |
rounded-t | border-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem; |
rounded-t-md | border-top-left-radius: 0.375rem; border-top-right-radius: 0.375rem; |
rounded-t-lg | border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; |
rounded-t-xl | border-top-left-radius: 0.75rem; border-top-right-radius: 0.75rem; |
rounded-t-2xl | border-top-left-radius: 1rem; border-top-right-radius: 1rem; |
rounded-t-3xl | border-top-left-radius: 1.5rem; border-top-right-radius: 1.5rem; |
rounded-t-full | border-top-left-radius: 9999px; border-top-right-radius: 9999px; |
rounded-r-none | border-top-right-radius: 0px; border-bottom-right-radius: 0px; |
rounded-r-sm | border-top-right-radius: 0.125rem; border-bottom-right-radius: 0.125rem; |
rounded-r | border-top-right-radius: 0.25rem; border-bottom-right-radius: 0.25rem; |
rounded-r-md | border-top-right-radius: 0.375rem; border-bottom-right-radius: 0.375rem; |
rounded-r-lg | border-top-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem; |
rounded-r-xl | border-top-right-radius: 0.75rem; border-bottom-right-radius: 0.75rem; |
rounded-r-2xl | border-top-right-radius: 1rem; border-bottom-right-radius: 1rem; |
rounded-r-3xl | border-top-right-radius: 1.5rem; border-bottom-right-radius: 1.5rem; |
rounded-r-full | border-top-right-radius: 9999px; border-bottom-right-radius: 9999px; |
rounded-b-none | border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; |
rounded-b-sm | border-bottom-right-radius: 0.125rem; border-bottom-left-radius: 0.125rem; |
rounded-b | border-bottom-right-radius: 0.25rem; border-bottom-left-radius: 0.25rem; |
rounded-b-md | border-bottom-right-radius: 0.375rem; border-bottom-left-radius: 0.375rem; |
rounded-b-lg | border-bottom-right-radius: 0.5rem; border-bottom-left-radius: 0.5rem; |
rounded-b-xl | border-bottom-right-radius: 0.75rem; border-bottom-left-radius: 0.75rem; |
rounded-b-2xl | border-bottom-right-radius: 1rem; border-bottom-left-radius: 1rem; |
rounded-b-3xl | border-bottom-right-radius: 1.5rem; border-bottom-left-radius: 1.5rem; |
rounded-b-full | border-bottom-right-radius: 9999px; border-bottom-left-radius: 9999px; |
rounded-l-none | border-top-left-radius: 0px; border-bottom-left-radius: 0px; |
rounded-l-sm | border-top-left-radius: 0.125rem; border-bottom-left-radius: 0.125rem; |
rounded-l | border-top-left-radius: 0.25rem; border-bottom-left-radius: 0.25rem; |
rounded-l-md | border-top-left-radius: 0.375rem; border-bottom-left-radius: 0.375rem; |
rounded-l-lg | border-top-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem; |
rounded-l-xl | border-top-left-radius: 0.75rem; border-bottom-left-radius: 0.75rem; |
rounded-l-2xl | border-top-left-radius: 1rem; border-bottom-left-radius: 1rem; |
rounded-l-3xl | border-top-left-radius: 1.5rem; border-bottom-left-radius: 1.5rem; |
rounded-l-full | border-top-left-radius: 9999px; border-bottom-left-radius: 9999px; |
rounded-tl-none | border-top-left-radius: 0px; |
rounded-tl-sm | border-top-left-radius: 0.125rem; |
rounded-tl | border-top-left-radius: 0.25rem; |
rounded-tl-md | border-top-left-radius: 0.375rem; |
rounded-tl-lg | border-top-left-radius: 0.5rem; |
rounded-tl-xl | border-top-left-radius: 0.75rem; |
rounded-tl-2xl | border-top-left-radius: 1rem; |
rounded-tl-3xl | border-top-left-radius: 1.5rem; |
rounded-tl-full | border-top-left-radius: 9999px; |
rounded-tr-none | border-top-right-radius: 0px; |
rounded-tr-sm | border-top-right-radius: 0.125rem; |
rounded-tr | border-top-right-radius: 0.25rem; |
rounded-tr-md | border-top-right-radius: 0.375rem; |
rounded-tr-lg | border-top-right-radius: 0.5rem; |
rounded-tr-xl | border-top-right-radius: 0.75rem; |
rounded-tr-2xl | border-top-right-radius: 1rem; |
rounded-tr-3xl | border-top-right-radius: 1.5rem; |
rounded-tr-full | border-top-right-radius: 9999px; |
rounded-br-none | border-bottom-right-radius: 0px; |
rounded-br-sm | border-bottom-right-radius: 0.125rem; |
rounded-br | border-bottom-right-radius: 0.25rem; |
rounded-br-md | border-bottom-right-radius: 0.375rem; |
rounded-br-lg | border-bottom-right-radius: 0.5rem; |
rounded-br-xl | border-bottom-right-radius: 0.75rem; |
rounded-br-2xl | border-bottom-right-radius: 1rem; |
rounded-br-3xl | border-bottom-right-radius: 1.5rem; |
rounded-br-full | border-bottom-right-radius: 9999px; |
rounded-bl-none | border-bottom-left-radius: 0px; |
rounded-bl-sm | border-bottom-left-radius: 0.125rem; |
rounded-bl | border-bottom-left-radius: 0.25rem; |
rounded-bl-md | border-bottom-left-radius: 0.375rem; |
rounded-bl-lg | border-bottom-left-radius: 0.5rem; |
rounded-bl-xl | border-bottom-left-radius: 0.75rem; |
rounded-bl-2xl | border-bottom-left-radius: 1rem; |
rounded-bl-3xl | border-bottom-left-radius: 1.5rem; |
rounded-bl-full | border-bottom-left-radius: 9999px; |
使用 ?.rounded-sm
?, ?.rounded
?, 或 ?.rounded-lg
? 等實用功能類來應(yīng)用不同的邊框半徑大小到一個元素上。
<div class="rounded-sm ..."></div>
<div class="rounded ..."></div>
<div class="rounded-md ..."></div>
<div class="rounded-lg ..."></div>
使用 ?rounded-full
? 功能類來創(chuàng)建藥丸形和圓圈。
<div class="rounded-full py-3 px-6...">Pill Shape</div>
<div class="rounded-full h-24 w-24 flex items-center justify-center...">Circle</div>
使用 ?rounded-none
? 從元素中刪除現(xiàn)有的邊框半徑。
這最常見的是用來刪除一個應(yīng)用在較小斷點上的邊框半徑。
<div class="rounded-none ...">.rounded-none</div>
使用 ?rounded-{t|r|b|l}{-size?}
? 只對元素的一側(cè)進(jìn)行圓角處理。
<div class="rounded-t-lg ...">.rounded-t-lg</div>
<div class="rounded-r-lg ...">.rounded-r-lg</div>
<div class="rounded-b-lg ...">.rounded-b-lg</div>
<div class="rounded-l-lg ...">.rounded-l-lg</div>
使用 ?rounded-{tl|tr|br|bl}{-size?}
? 只將圓角應(yīng)用到元素的一個邊角上。
<div class="rounded-tl-lg ..."></div>
<div class="rounded-tr-lg ..."></div>
<div class="rounded-br-lg ..."></div>
<div class="rounded-bl-lg ..."></div>
要在特定的斷點處控制元素的邊界半徑,請在任何現(xiàn)有的邊界半徑功能類中添加 ?{screen}:
? 前綴。例如,使用 ?md:rounded-lg
? 來應(yīng)用 ?rounded-lg
? 功能類,只適用于中等尺寸以上的屏幕。
<div class="rounded md:rounded-lg ...">
<!-- ... -->
</div>
關(guān)于 Tailwind 的響應(yīng)式設(shè)計功能的更多信息,請查看響應(yīng)式設(shè)計文檔。
默認(rèn)情況下,Tailwind 提供了五個邊框半徑大小的實用工具。你可以通過編輯你的 Tailwind 配置中的?theme.borderRadius
?部分來改變、添加或刪除這些。
// tailwind.config.js
module.exports = {
theme: {
borderRadius: {
'none': '0',
'sm': '0.125rem',
DEFAULT: '0.25rem',
DEFAULT: '4px',
'md': '0.375rem',
'lg': '0.5rem',
'full': '9999px',
'large': '12px',
}
}
}
默認(rèn)情況下, 針對 border radius 功能類,只生成 responsive 變體。
您可以通過修改您的 ?tailwind.config.js
? 文件中的 ?variants
?部分中的 ?borderRadius
?屬性來控制為 border radius 功能生成哪些變體。
例如,這個配置也將生成 hover and focus 變體:
// tailwind.config.js
module.exports = {
variants: {
extend: {
// ...
borderRadius: ['hover', 'focus'],
}
}
}
如果您不打算在您的項目中使用 border radius 功能,您可以通過在配置文件的 ?corePlugins
?部分將 ?borderRadius
?屬性設(shè)置為 ?false
?來完全禁用它們:
// tailwind.config.js
module.exports = {
corePlugins: {
// ...
borderRadius: false,
}
}
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: