- auto
區塊元素除了寬度 width ,還有高度 height ,通常兩者都需設定,若只有設定其中一個,另一個瀏覽器 (broswer) 通常會自動調整。
舉例如下
.example {
width: auto;
}
/* 《程式語言教學誌》的範例程式
http://pydoing.blogspot.com/
檔名:block01.css
功能:示範 CSS 2.1 樣式表的使用
作者:張凱慶
時間:西元 2011 年 7 月 */我們以下面的 HTML 文件載入
<html>
<head>
<title>網頁標題</title>
<link rel="stylesheet" type="text/css"
href="block01.css">
</head>
<body>
<img class="example" src="example.jpg">
</body>
</html>
<!-- 《程式語言教學誌》的範例程式
htt://pydoing.blogspot.com/
檔名:block01.html
功能:示範 CSS 2.1 樣式表的使用
作者:張凱慶
時間:西元 2011 年 7 月 -->瀏覽器開啟如下

使用數字或百分比如下例
.example1 {
width: 200px;
}
.example2 {
width: 25%;
}
/* 《程式語言教學誌》的範例程式
http://pydoing.blogspot.com/
檔名:block02.css
功能:示範 CSS 2.1 樣式表的使用
作者:張凱慶
時間:西元 2011 年 7 月 */我們以下面的 HTML 文件載入
<html>
<head>
<title>網頁標題</title>
<link rel="stylesheet" type="text/css"
href="block02.css">
</head>
<body>
<img class="example1" src="example.jpg">
<img class="example2" src="example.jpg">
</body>
</html>
<!-- 《程式語言教學誌》的範例程式
htt://pydoing.blogspot.com/
檔名:block02.html
功能:示範 CSS 2.1 樣式表的使用
作者:張凱慶
時間:西元 2011 年 7 月 -->瀏覽器開啟如下

| 中英文術語對照 | |
|---|---|
| 性質 | property |
| 區塊元素 | block element |
| 關鍵字 | keyword |
| 瀏覽器 | broswer |
您可以繼續參考
JavaScript 範例
區塊相關
- 寬度 width
- 高度 height
- 邊界 margin
- 左邊界 margin-left
- 右邊界 margin-right
- 上邊界 margin-top
- 下邊界 margin-bottom
- 邊距 padding
- 左邊距 padding-left
- 右邊距 padding-right
- 上邊距 padding-top
- 下邊距 padding-bottom
- 邊框格式 border-style
- 左邊框格式 border-left-style
- 右邊框格式 border-right-style
- 上邊框格式 border-top-style
- 下邊框格式 border-bottom-style
- 邊框粗細 border-width
- 左邊框粗細 border-left-width
- 右邊框粗細 border-right-width
- 上邊框粗細 border-top-width
- 下邊框粗細 border-bottom-width
- 邊框顏色 border-color
- 左邊框顏色 border-left-color
- 右邊框顏色 border-right-color
- 上邊框顏色 border-top-color
- 下邊框顏色 border-bottom-color
- 邊框 border
- 左邊框 border-left
- 右邊框 border-right
- 上邊框 border-top
- 下邊框 border-bottom
相關目錄
CSS 2.1 快速導覽
HTML, CSS 教材
首頁
參考資料
http://www.w3.org/TR/CSS21/visudet.html
https://developer.mozilla.org/en/CSS/width
沒有留言:
張貼留言