本篇文章為大家展示了怎么用border-style屬性,代碼簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細(xì)介紹希望你能有所收獲。
成都創(chuàng)新互聯(lián)公司于2013年成立,先為詔安等服務(wù)建站,詔安等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢服務(wù)。為詔安企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問題。
border-style屬性用于同時(shí)為一個(gè)元素的四個(gè)邊框設(shè)置樣式,或者單獨(dú)地為各邊設(shè)置邊框樣式。
CSS border-style屬性
作用:用于設(shè)置元素所有邊框的樣式,或者單獨(dú)地為各邊設(shè)置邊框樣式。它可以有一到四個(gè)值,例:
p.one {border-style:dotted dashed solid double;} p.two {border-style:dotted solid double;} p.three {border-style:dotted solid;} p.four {border-style:dotted;}
效果圖:
說明:只有當(dāng)border-style屬性的值不是 none 時(shí)邊框才可能出現(xiàn)。
可以設(shè)置的屬性值:
none:定義無邊框。
hidden:與 "none" 相同。不過應(yīng)用于表時(shí)除外,對于表,hidden 用于解決邊框沖突。
dotted:定義點(diǎn)狀邊框。在大多數(shù)瀏覽器中呈現(xiàn)為實(shí)線。
dashed:定義虛線。在大多數(shù)瀏覽器中呈現(xiàn)為實(shí)線。
solid:定義實(shí)線。
double:定義雙線。雙線的寬度等于 border-width 的值。
groove:定義 3D 凹槽邊框。其效果取決于 border-color 的值。
ridge:定義 3D 壟狀邊框。其效果取決于 border-color 的值。
inset:定義 3D inset 邊框。其效果取決于 border-color 的值。
outset:定義 3D outset 邊框。其效果取決于 border-color 的值。
inherit:規(guī)定應(yīng)該從父元素繼承邊框樣式。
CSS border-style屬性的使用示例
<!DOCTYPE html> <html> <head> <style type="text/css"> p.dotted {border-style: dotted} p.dashed {border-style: dashed} p.solid {border-style: solid} p.double {border-style: double} p.groove {border-style: groove} p.ridge {border-style: ridge} p.inset {border-style: inset} p.outset {border-style: outset} </style> </head> <body> <p class="dotted">dotted邊框</p> <p class="dashed">dashed邊框</p> <p class="solid">solid邊框</p> <p class="double">double邊框</p> <p class="groove">groove邊框</p> <p class="ridge">ridge邊框</p> <p class="inset">inset邊框</p> <p class="outset">outset邊框</p> </body> </html>
效果圖:
上述內(nèi)容就是怎么用border-style屬性,你們學(xué)到知識或技能了嗎?如果還想學(xué)到更多技能或者豐富自己的知識儲備,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
名稱欄目:怎么用border-style屬性
文章轉(zhuǎn)載:http://chinadenli.net/article6/pgpjig.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、服務(wù)器托管、商城網(wǎng)站、營銷型網(wǎng)站建設(shè)、電子商務(wù)、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)