常見(jiàn)的樣式
- 屬性 :屬性值
- width : 寬度
- heigth: 高度
- background 背景
background-attachment:fixed; //背景是否滾動(dòng)
background-color :red; // 背景顏色
background-image:url(bg.jpg);// 背景圖片
background-repeat:no-repeat;//背景是否重復(fù)
background-postion:center 0px;// 背景圖位置
——border 邊框樣式
border-width: 10px;//寬度
border-style: solid;//樣式
border-color: red;// 顏色
border-style 邊框樣式
border-style: solid;//實(shí)線
border-style: dashed;//虛線
padding 內(nèi)邊距
padding-top: 100px; //上邊距
padding-right: 100px; // 右邊距
padding-bottom: 100px;//下邊距
padding-left: 100px;//左邊距
// padding: top right bottom left;
//注意:內(nèi)邊距相當(dāng)于給一個(gè)盒子加了填充厚度會(huì)影響盒子大小。
margin 外邊距
1:上下外邊距會(huì)疊壓
2:父子級(jí)包含的時(shí)候子級(jí)的margin-top會(huì)傳遞給父級(jí);(內(nèi)邊距替代外邊距)
margin-top: 100px; //上邊距
margin-right: 100px; // 右邊距
margin-bottom: 100px;//下邊距
margin-left: 100px;//左邊距
// margin: top right bottom left;
//注意:內(nèi)邊距相當(dāng)于給一個(gè)盒子加了填充厚度會(huì)影響盒子大小。
text 文本基本設(shè)置
/*
font-size 文字大?。ㄒ话憔鶠榕紨?shù))
font-family 字體(中文默認(rèn)宋體)
color 文字顏色(英文、rgb、十六位進(jìn)制色彩值)
line-height 行高
text-align 文本對(duì)齊方式
text-indent 首行縮進(jìn)(em縮進(jìn)字符)
font-weight 文字著重
font-style 文字傾斜
text-decoration 文本修飾
letter-spacing 字母間距
word-spacing 單詞間距(以空格為解析單位)
font:font-style | font-weight | font-size/line-height | font-family;
*/