CSS基本屬性
阿新 • • 發佈:2018-05-16
col 屬性 clas pre wid style ott round bsp
背景屬性
背景顏色
div{ height: 200px; width: 200px; background-color: #ccc; }
背景圖片
div{ height: 200px; width: 200px; background-image: url(img/bg.png); }
背景重復
div{ height: 200px; width: 200px; background-image: url(img/bg.png); background-repeat: repeat-x; /* 不添加此屬性,則縱向橫向都重復 repeat-x 橫向重復 repeat-y 縱向重復 no-repeat 不重復*/ }
背景位置
background-position: x y; /*xy分別表示x軸位置和y軸位置*/ /* 橫向(left,center,right) 縱向 (top, center,bottom) */
CSS基本屬性