CSS 2.1 快速導覽 - 邊框格式 border-style

border-style 性質 (property) 為 CSS 中用來設定區塊元素 (block element) 邊框 (border) 的速記性質,有以下的關鍵字 (keyword)

  • none
  • hidden
  • dotted
  • dashed
  • solid
  • double
  • groove
  • ridge
  • inset
  • outset


另外還有左邊框格式 border-left-style 、右邊框格式 border-right-style 、上邊框格式 border-top-style ,下邊框格式 border-bottom-style 。


舉例如下
img {
    width: 120;
    height: 80;
    padding: 5px;
    margin: 3px;
}

.examplenone {
    border-style: none;
}

.examplehidden {
    border-style: hidden;
}

.exampledotted {
    border-style: dotted;
}

.exampledashed {
    border-style: dashed;
}

.examplesolid {
    border-style: solid;
}

.exampledouble {
    border-style: double;
}

.examplegroove {
    border-style: groove;
}

.exampleridge {
    border-style: ridge;
}

.exampleinset {
    border-style: inset;
}

.exampleoutset {
    border-style: outset;
}

/* 《程式語言教學誌》的範例程式
    http://pydoing.blogspot.com/
    檔名:block19.css
    功能:示範 CSS 2.1 樣式表的使用 
    作者:張凱慶
    時間:西元 2011 年 7 月 */


我們以下面的 HTML 文件載入
<html>
<head>
<title>網頁標題</title>
<link rel="stylesheet" type="text/css" 
      href="block19.css">
</head>
<body>
<img class="examplenone" src="example.jpg">
<img class="examplehidden" src="example.jpg">
<img class="exampledotted" src="example.jpg">
<img class="exampledashed" src="example.jpg">
<img class="examplesolid" src="example.jpg">
<img class="exampledouble" src="example.jpg">
<img class="examplegroove" src="example.jpg">
<img class="exampleridge" src="example.jpg">
<img class="exampleinset" src="example.jpg">
<img class="exampleoutset" src="example.jpg">
</body>
</html>

<!-- 《程式語言教學誌》的範例程式
     htt://pydoing.blogspot.com/
     檔名:block19.html
     功能:示範 CSS 2.1 樣式表的使用 
     作者:張凱慶
     時間:西元 2011 年 7 月 -->


瀏覽器 (broswer) 開啟如下



中英文術語對照
性質property
區塊元素block element
邊框border
關鍵辜keyword
瀏覽器broswer


您可以繼續參考

Javascript 範例

區塊相關


相關目錄
CSS 2.1 快速導覽
HTML, CSS 教材
首頁


參考資料
http://www.w3.org/TR/CSS21/box.html
https://developer.mozilla.org/en/CSS/border-style

沒有留言: