這篇是介紹一些基本常用的CSS語法。
背景部份
background-color: #______; 背景顏色
background: transparent; 透明背景
background-image: url('圖片網址'); 設定背景來源
background-repeat: repeat, repeat-x, repeat-y, no-repeat; 設定視窗背景佈滿的方式
background-attachment: fixed (固定), scroll (捲動); 設定視窗背景固定或隨捲軸捲動
background-position: (x% y%); 設定視窗背景的位置
x: 左到右(0% = left;100% = right)
y: 上到下(0% = top; 100% = bottom)
間距和邊框部份
padding: __px(top) __px(right) __px(bottom) __px(left); 設定內容與邊框之間的距離
border-color: #______; 設定邊框的顏色
border-width: __px; 設定邊框的粗細
border-style: solid (直線), dotted (點線), dashed (虛線), double (雙線), inset (凹框), outset (凸框); 設定邊框的樣式
文字部分
text-decoration: none (不加連結底線), underline (加底線), overline (加頂線), line-through (加刪除線);
vertical-align: sub (下標字), super (上標字);
text-transform: capitalize (首字大寫), uppercase (大寫); lowercase (小寫);
text-align: left, right, center, justify (分散對齊);
vertical-align (垂直對齊): top, bottom, middle;
參考網站:
》Peter's CSS Note
》CSS 基本概述
》OECSPACE
背景部份
background-color: #______; 背景顏色
background: transparent; 透明背景
background-image: url('圖片網址'); 設定背景來源
background-repeat: repeat, repeat-x, repeat-y, no-repeat; 設定視窗背景佈滿的方式
background-attachment: fixed (固定), scroll (捲動); 設定視窗背景固定或隨捲軸捲動
background-position: (x% y%); 設定視窗背景的位置
x: 左到右(0% = left;100% = right)
y: 上到下(0% = top; 100% = bottom)
間距和邊框部份
padding: __px(top) __px(right) __px(bottom) __px(left); 設定內容與邊框之間的距離
border-color: #______; 設定邊框的顏色
border-width: __px; 設定邊框的粗細
border-style: solid (直線), dotted (點線), dashed (虛線), double (雙線), inset (凹框), outset (凸框); 設定邊框的樣式
文字部分
text-decoration: none (不加連結底線), underline (加底線), overline (加頂線), line-through (加刪除線);
vertical-align: sub (下標字), super (上標字);
text-transform: capitalize (首字大寫), uppercase (大寫); lowercase (小寫);
text-align: left, right, center, justify (分散對齊);
vertical-align (垂直對齊): top, bottom, middle;
參考網站:
》Peter's CSS Note
》CSS 基本概述
》OECSPACE
全站熱搜
留言列表