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