css border-bottom用法詳解

來源:互聯網
上載者:User

border-bottom(指定下邊線的樣式、寬度及顏色)


border-bottom: 值;

border-bottom-style:值;

border-bottom-color: 值;

border-bottom-width:值;

如:

border-bottom: solid 1px #ffff00;

border-bottom-style: outset;

border-bottom-color: #0000ff;

border-bottom-width:15px;

border-bottom屬性用於指定下邊線的樣式、寬度及顏色,值之間用半形空格間隔,沒有先後順序。

關於border-bottom屬性的樣式的值,具體可參照邊線的樣式。邊線的寬度的值,具體可參照邊線的寬度。

當分別指定下邊線的樣式、寬度、顏色時使用以下屬性:

  • border-bottom-color:下邊線的顏色

  • border-bottom-style:下邊線的樣式

  • border-bottom-width:下邊線的寬度

border-bottom的值及其說明
屬性 說明
border-bottom solid 下邊線為實線
其他的值還有:groove、dotted等,詳細請參照邊線樣式。
1px 下邊線的寬度
使用數值可以表示邊線的任意寬度,數值單位除了px,還有em、ex,詳細請參照數值+單位
使用關鍵詞指定
thin(細)、medium(普通)、thick(粗)
#ff0000 下邊線的顏色
除了使用顏色代碼錶示具體顏色之外,邊線還可以指定為透明即:transparent

執行個體

css檔案



.sample1,.sample2,.sample3{margin:0.5em;padding:2px;}.sample1 {border-bottom: solid 1px #ffff00;}.sample2 {border-bottom: groove 10px #00ff00;}.sample3 {border-bottom-style: ridge;border-bottom-color: #0000ff;border-bottom-width:15px;}

連結了上述css檔案的html檔案



<!DOCTYPE html><html lang="zh"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1"><link href="material/border-bottom.css" rel="stylesheet" type="text/css" /><title>border-bottom屬性(http://wwww.manongjc.com)</title></head><body><p class="sample1">sample1:下邊線 solid 1px #ffff00</p><p class="sample2">sample2:下邊線 groove 10px #00ff00</p><p class="sample3">sample3:分別指定下邊線的樣式、寬度、顏色 </p></body></html>
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.