CSS字体属性
字体属性 | 含义 | 举例 |
---|---|---|
font-family | 设置字体类型 | {font-family:“宋体”;} |
font-size | 设置字体大小 | {font-size:12px;} |
font-style | 设置字体风格 | {font-style:italic;} //斜体 |
font-weight | 设置字体粗细 | {font-weight:500;} |
font | 设置所有字体属性 | 风格 -> 粗细 -> 大小 -> 类型 |
CSS文本属性
文本属性 | 含义 | 举例 |
---|---|---|
color | 设置文本颜色 | color:red; |
text-align | 设置文本水平对齐方式 | text-align:center; |
line-height | 设置文本的行高 | line-height:25px; |
CSS背景属性
背景属性 | 含义 | 举例 |
---|---|---|
background-color | 设置背景颜色 | background-color: gray; //背景灰 |
ackground-image | 设置背景图片 | background-image: url(‘图片位置’) |
background-repeat | 设置背景图片重复方式 | background-repeat : repeat //背景图片重复 |
background-attachment | 设置背景是否随页面滚动 | background-attachment:local; //背景图片会随着元素内容的滚动而滚动。 |
background-position | 设置背景图片位置 | background-position: right top; //右上角 |