W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
用于控制元素邊框?qū)挾鹊墓δ茴悺?/p>
Class
|
Properties
|
---|---|
border-0 | border-width: 0px; |
border-2 | border-width: 2px; |
border-4 | border-width: 4px; |
border-8 | border-width: 8px; |
border | border-width: 1px; |
border-t-0 | border-top-width: 0px; |
border-t-2 | border-top-width: 2px; |
border-t-4 | border-top-width: 4px; |
border-t-8 | border-top-width: 8px; |
border-t | border-top-width: 1px; |
border-r-0 | border-right-width: 0px; |
border-r-2 | border-right-width: 2px; |
border-r-4 | border-right-width: 4px; |
border-r-8 | border-right-width: 8px; |
border-r | border-right-width: 1px; |
border-b-0 | border-bottom-width: 0px; |
border-b-2 | border-bottom-width: 2px; |
border-b-4 | border-bottom-width: 4px; |
border-b-8 | border-bottom-width: 8px; |
border-b | border-bottom-width: 1px; |
border-l-0 | border-left-width: 0px; |
border-l-2 | border-left-width: 2px; |
border-l-4 | border-left-width: 4px; |
border-l-8 | border-left-width: 8px; |
border-l | border-left-width: 1px; |
使用 ?border
?, ?.border-0
?, ?.border-2
?, ?.border-4
?, 或 ?.border-8
? 等功能類來設(shè)置一個元素所有邊框的寬度。
<div class="border-0 border-indigo-600 ..."></div>
<div class="border border-indigo-600 ..."></div>
<div class="border-2 border-indigo-600 ..."></div>
<div class="border-4 border-indigo-600 ..."></div>
<div class="border-8 border-indigo-600 ..."></div>
使用 ?border-{side}
?, ?.border-{side}-0
?, ?.border-{side}-2
?, ?.border-{side}-4
?, 或 ?.border-{side}-8
? 等功能類來設(shè)置元素一側(cè)的邊框?qū)挾取?/p>
<div class="border-t-2 border-fuchsia-600 ..."></div>
<div class="border-r-2 border-fuchsia-600 ..."></div>
<div class="border-b-2 border-fuchsia-600 ..."></div>
<div class="border-l-2 border-fuchsia-600 ..."></div>
您還可以使用 ?divid-{x/y}-{width}
? 和 ?divid-{color}
? 功能類在子元素之間添加邊框。
<div class="divide-y divide-light-blue-400 ...">
<div>1</div>
<div>2</div>
<div>3</div>
<div></div>
</div>
要在特定的斷點處控制元素的邊框?qū)挾?,請在任何現(xiàn)有的邊框?qū)挾裙δ茴愔刑砑?nbsp;?{screen}:
? 前綴。例如,使用 ?md:border-t-4
? 來應(yīng)用 ?border-t-4
? 功能類,只適用于中等尺寸以上的屏幕。
<div class="border-2 md:border-t-4 ..."></div>
關(guān)于 Tailwind 的響應(yīng)式設(shè)計功能的更多信息,請查看響應(yīng)式設(shè)計文檔。
默認(rèn)情況下, 針對 border width 功能類,只生成 responsive 變體。
您可以通過修改您的 ?tailwind.config.js
? 文件中的 ?variants
?部分中的 ?borderWidth
?屬性來控制為 border width 功能生成哪些變體。
例如,這個配置也將生成 hover and focus 變體:
// tailwind.config.js
module.exports = {
variants: {
extend: {
// ...
borderWidth: ['hover', 'focus'],
}
}
}
如果您不打算在您的項目中使用 border width 功能,您可以通過在配置文件的 ?corePlugins
?部分將 ?borderWidth
?屬性設(shè)置為 ?false
?來完全禁用它們:
// tailwind.config.js
module.exports = {
corePlugins: {
// ...
borderWidth: false,
}
}
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: