颜色属性(style里)
设置外边距: margin
浮动: float
背景颜色: hsl(240,100%,40%)
h:色相/色调 s:饱和度 l:亮度/明度 a:透明度
下划线
text-decoration:none; 没有下划线
text-decoration:underline red; 红色下划线
text-decoration:underline wavy red; 红色波浪线
列表属性
list-style-type:circle; 空心圆
float:left; 向左浮动
margin-left:10px; 外边距居左10个像素
padding:2px; 内边距
背景
| image | 设置背景图片 |
|---|---|
| color | 设置背景颜色 |
| repeat | 设置背景是否平铺 |
| no-repeat | 不平铺 |
| repeat-X | 沿X轴平铺 |
| repeat-Y | yanY轴平铺 |
| size | 设置背景大小 |
| 100% | 百分比显示 |
| cover | 平铺 |
| position | 定位 |
固定背景:background-attachment:fixed;
百分比
1个参数 四个方向
2个参数 水平,垂直
水平 left center right
垂直 top center bottom
本文深入探讨了CSS中颜色属性、外边距、浮动、背景颜色的设置方法,包括使用HSL模型调整色调、饱和度和亮度。同时,讲解了如何去除和添加不同样式的下划线,列表项的样式修改,以及背景图片和平铺效果的设置技巧。
1万+

被折叠的 条评论
为什么被折叠?



