一.表格样式
1.表格标题位置(caption-side)
caption-side:取值;
属性值 | 说明 |
top | 标题在顶部(默认值) |
bottom | 标题在底部 |
2.表格边框合并(border-collapse)
border-collapse:取值;
属性值 | 说明 |
separate | 边框分开,有空隙(默认值) |
collapse | 边框合并,无空隙 |
3.表格边框间距(border-spacing)
border-spacing:像素值;
二.图片样式
1.图片大小
width:像素值;
height:像素值;
2.图片边框
border:1px solid red;
3.图片对齐
水平对齐:
text-align:取值;
取值:left(左对齐)、center(居中对齐)、right(右对齐)
垂直对齐:
vertical-align:取值;
取值:top(顶部对齐)、middle(中部对齐)、baseline(基线对齐)、bottom(底部对齐)
4.文字环绕-初始float
float:取值;
取值:left(元素向左浮动)、right(元素向右浮动)
三.背景样式
1.背景颜色(background-color)
background-color:颜色值;
颜色值:1.关键字 2.16进制RGB
2.背景图片样式(background-image)
background-image:url(图片路径);
3.背景图片重复(background-repeat)
background-repeat:取值;
属性值 | 说明 |
repeat | 在水平方向和垂直方向上同时平铺 |
repeat-x | 只在水平方向上平铺 |
repeat-y | 只在垂直方向上平铺 |
no-repeat | 不平铺 |
4.背景图片位置(background-position)
background-position:像素值/关键字;
4.1像素值:background-position:水平距离 垂直距离;
4.2关键字:background-position:水平距离 垂直距离;
属性值 | 说明 |
top left | 左上 |
top center | 靠上居中 |
top right | 右上 |
left center | 靠左居中 |
center center | 正中 |
right center | 靠右居中 |
bottom left | 左下 |
bottom center | 靠下居中 |
bottom right | 右下 |
5.背景图片固定(background-attachment)
background-attachment:取值;
属性值 | 说明 |
scroll | 随元素一起滚动(默认值) |
fixed | 固定不动 |