您好,登錄后才能下訂單哦!
今天小編給大家分享一下html中文本下面怎么實(shí)現(xiàn)虛線的相關(guān)知識點(diǎn),內(nèi)容詳細(xì),邏輯清晰,相信大部分人都還太了解這方面的知識,所以分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后有所收獲,下面我們一起來了解一下吧。
在html中,可以使用border-bottom設(shè)置文本下面有虛線,只需要給文本元素設(shè)置“border-bottom:width dashed color”樣式即可。設(shè)置元素下邊框的樣式時(shí),只有當(dāng)這個(gè)值不是none時(shí)邊框才可能出現(xiàn)。
本教程操作環(huán)境:windows7系統(tǒng)、CSS3&&HTML5版、Dell G3電腦。
border-bottom 簡寫屬性把下邊框的所有屬性設(shè)置到一個(gè)聲明中。
可以按順序設(shè)置如下屬性:
border-bottom-width
border-bottom-style
border-bottom-color
語法:
border-bottom:width style color;
如果不設(shè)置其中的某個(gè)值,也不會出問題,比如 border-bottom:solid #ff0000; 也是允許的
設(shè)置元素下邊框的樣式時(shí),只有當(dāng)這個(gè)值不是 none 時(shí)邊框才可能出現(xiàn)。
例子:
<html> <head> <style type="text/css"> p { border-style: solid; } p.none { border-bottom-style: none; } p.dotted { border-bottom-style: dotted; } p.dashed { border-bottom-style: dashed; } p.solid { border-bottom-style: solid; } p.double { border-bottom-style: double; } p.groove { border-bottom-style: groove; } p.ridge { border-bottom-style: ridge; } p.inset { border-bottom-style: inset; } p.outset { border-bottom-style: outset; } </style> </head> <body> <p class="none">No bottom border.</p> <p class="dotted">A dotted bottom border.</p> <p class="dashed">A dashed bottom border.</p> <p class="solid">A solid bottom border.</p> <p class="double">A double bottom border.</p> <p class="groove">A groove bottom border.</p> <p class="ridge">A ridge bottom border.</p> <p class="inset">An inset bottom border.</p> <p class="outset">An outset bottom border.</p> </body> </html>
效果:
擴(kuò)展資料:
border-bottom-color 設(shè)置元素的下邊框的顏色。
只能定義純色,而且只有當(dāng)邊框的樣式是一個(gè)非 none 或 hidden 的值時(shí)邊框才可能出現(xiàn)。
注釋:請始終把 border-style 屬性聲明到 border-color 屬性之前。元素必須在您改變其顏色之前獲得邊框。
以上就是“html中文本下面怎么實(shí)現(xiàn)虛線”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家閱讀完這篇文章都有很大的收獲,小編每天都會為大家更新不同的知識,如果還想學(xué)習(xí)更多的知識,請關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。