學習網頁標準製作網頁之CSS混合布局應用
來源:互聯網
上載者:User
一、Margin(框距)padding(邊框距)
margin屬性設定順序:上右下左
padding屬性設定順序:上右下左
margin:25px 0 25px 0;
簡寫:margin:25px 0;
二、Display顯示內容設定
(1)、Display屬性none (隱藏)
.alt {display:none;}
<span class=”alt”>Content List Part</span>
(2)、Display屬性block (塊/地區)
Img {display:block;}
<img href=”1.gif”></img>
區塊層級元素:存在自身的“盒”中,後面跟隨一個預設的斷行符號
內嵌元素:是流的一部分,後面不跟隨斷行符號
(3)、Display屬性inline
區別block元素,使用inline狀態時,顯示方式按照內嵌元素顯示
三、 動態連結屬性設定:
a:link {
font-weight : bold;
text-decoration : none;
color: #c30;
background: transparent;
}
a:visited {
font-weight : bold;
text-decoration : none;
color: #c30;
background: transparent;
}
a:hover {
font-weight : bold;
text-decoration : underline;
color: #f60;
background: transparent;
}
a:active {
font-weight : bold;
text-decoration : none;
color: #f90;
background: transparent;
}
(1)文字修飾屬性(text-decoration)
Text-decoration:underline overline none;
Underline:連結時有底線
Overline:串連時有上劃線
None:串連時無底線
(2)動態串連屬性順序
(LVHA)- LoVe-HA!
(3)IE/WINDOWS的偽裝欺騙性
應避免使用a:active屬性:出現bug 串連會出現凍結現象
四、如何設定行高(line-height)
Line-height:1.5;
五、如何設定文章位置(text-align)
可選擇屬性(left middle right)
IE6/WINDOWS的BUG會錯誤使文檔置中
六、對於字型的完整CSS應用
Font:13px/1.5 Georigia,”New Centeury Schoolbook”,Times,serif;
七、設定頁面分界限
(1)vertical-align:middle; 等於 <td valign=”middle”>設定垂直對齊
(2)background:none 等於 background:url(images/1.gif) repeat;
八、設定顯示器裝置
<style type=”text/css” media=”screen”> media屬性
使用HTML4.01轉換到XHTML1.0過渡式transitional