1.背景设置
.box { width: 100px; height: 100px; background-color: red; background-image: url('./课件/images/icon1.png'); /* 背景重复background-repeat: no-repeat | repeat-x | repeat-y */ background-repeat: no-repeat; /* 设置背景位置 */ background-position-x: center; 延x轴进行居中 background-position-y: center; 延y轴进行居中 background-attachment: fixed | scroll; fixed:背景图片不会随着页面的滚动而滚动。 scroll: 背景图片随着页面的滚动而滚动,这是默认的。 background-size:cover; 此时会保持图像的纵横比并将图像缩放成将完全覆盖背景定位区域的最小大小。 相当于background-size:100% 100%; background: color image repeat position } </style> </head> <body> <div class="box"></div> </body>
2.字体
font-size 大小
font-style: normal | italic 倾斜
font-weight: normal | bold | lighter 粗细
3.文本
line-height 行高
text-align:center
文本修饰text-decoration: underline下划线 | line-through删除线 | overline上划线
text-decoration:none
text-indent 文本缩进!!!
word-spacing 词语间距
letter-spacing 字母间距(中文用这个)
4.ul
ul{
list-style:none 去除圆点
list-style-type:square 变正方形
list-style-type:circle 变圆形
list-style-type:disc 实心圆
}
5.表格
<tr> 元素定义表格行,<th> 元素定义表头,<td> 元素定义表格单元。
border-collapse:collapse 边框折叠
//设置表格的边框被折叠成一个单一的边框
//在th,td设置这个两个属性
colspan:[1/2/3/...] // 表示向右合并单元格。
rowspan:[1/2/3/...] // 表示向下合并单元格,
6.继承