divs&Layout
★div:division,是個block-level tag,用於把body內的內容分成不同部分
★改變div的寬度 width
★置中(寬度固定時) margin: 0 auto 0 auto (讓左右auto)
★文字置中text-align:center;
★改變div的寬度 width
★置中(寬度固定時) margin: 0 auto 0 auto (讓左右auto)
★文字置中text-align:center;
Content Images
★web裡的影像大致分成以下三種:
☆content images(和內文一樣,必需的)
☆layout images(美觀用的背景圖)
☆user interface images(和介面相關,但非必要)
★<img>
<img src="圖片網址" alt="圖片敘述"> (沒有closing tag喔)
☆alt的功能:當圖片變成叉燒包的時候,人家才知道這張圖片是什麼
★背景
☆預設背景顏色(background-color),圖片讀不出來時顯示
☆背景圖片 background-image:url(圖片網址);
☆背景圖片位置 background-position
第一個字可用top(上)、center(中)、bottom(下)
第二個字可用left(左)、center(中)、right(右)
EX:background-position:top left
☆背景顏色重複 background-repeat
可填入repeat、repeat-x、repeat-y、no-repeat
☆可依顏色、圖片、位置、重複的順序一行寫完:
EX:background:#555555 url(images/bg.jpg) top left repeat;
☆content images(和內文一樣,必需的)
☆layout images(美觀用的背景圖)
☆user interface images(和介面相關,但非必要)
★<img>
<img src="圖片網址" alt="圖片敘述"> (沒有closing tag喔)
☆alt的功能:當圖片變成叉燒包的時候,人家才知道這張圖片是什麼
★背景
☆預設背景顏色(background-color),圖片讀不出來時顯示
☆背景圖片 background-image:url(圖片網址);
☆背景圖片位置 background-position
第一個字可用top(上)、center(中)、bottom(下)
第二個字可用left(左)、center(中)、right(右)
EX:background-position:top left
☆背景顏色重複 background-repeat
可填入repeat、repeat-x、repeat-y、no-repeat
☆可依顏色、圖片、位置、重複的順序一行寫完:
EX:background:#555555 url(images/bg.jpg) top left repeat;