CSS設定:背景圖片、文字、區塊

開發網頁過程,較常使用的的CSS設定:背景圖片、文字、區塊

背景圖片

opacity:0-1 此為透明度設定
width:x 寬度為x
height:x 高度為x
background-image:url(../x/y) 設定背景圖片
background-size: cover[完整圖片];contain[可超出範圍]
background-attachment: 設定圖片固定或滑動
visibility: 設定是否隱藏
position: 設定圖片位置

字型

font-size: 字體大小
font-family: 字體選擇
line-height: 字距
color: 字體顏色
text-shadow:x,y,z,a x字體陰影;y陰影大小;z模糊度;a顏色
font-weight:blod 字體加粗
text-decoration:none 去除底線

區塊

padding: 內距
margin: 邊界空隙
float:

浮動方向
 left:向左浮動
right:向右浮動
none:不符動

text-align: 內容縱向位置
vertical-align: 內容橫向位置
height: 高度
width: 寬度
overflow:

元素超出範圍
auto:預設scroll
visible:直接超出範圍
hidden:自動隱藏
scroll:自動產生捲軸

z-index: 3D視野-前
position:fixed 固定位置
display: 區塊方式呈現
inline:同一行呈現
block:區塊呈現[可更改位置]
none:刪除區塊
visibility:hidden 隱藏區塊,保留位置
border: 線條樣式
border-size: 線條粗細大小
border-top:solid 1px 區塊上方加一條線
clear:

清除浮動區塊
 left:清除左邊浮動區塊
right:清除右邊浮動區塊
both:清除兩邊浮動區塊
none:兩邊都可以有浮動區塊(預設)

參考資料

學習 CSS 版面配置

Wibibi網頁設計教學百科