div{ width: 400px; height: 500px; } # 背景颜色渐变 dt{ background-image:linear-gradient(to top,red,rgb(9, 255, 0)) ; } h3{ background-image: linear-gradient(to left,pink,rgb(0, 255, 149)); } # 字体样式 dt,h3,p,dd{ font-family: "隶书"; # 字体 font-weight: 300px; # 文字粗细 font-style: italic; # 倾斜 font-size: 20px; # 大小 font:style weight size family; # 综合设置,规矩填写 } # 文本样式 p{ text-indent: 20px; # 首行缩进 line-height: 30px; # 一行高度 color:blue; # 字体颜色 text-align:center; # 文字居中 text-align:left; # 文字靠左 text-align:right; # 靠右 text-decoration:none; # 消除划线 text-decoration:underline; # 添加下线 text-decoration:overline; # 添加上线 text-decoration:underline overline; 上下添加 text-shadow: 5px 5px 5px #ff0000; # ↑水平 ↑垂直 ↑模糊 ↑颜色 距离 } img{ # ↓居中 ↓上 ↓下 verical-align:middle|top|bottom; # img适用 } # 背景 dt,h3{ background-image:url('1772.jpg_wh1200.jpg') # 背景图片 # ↓显示一次 ↓向左平铺 ↓向下平铺 ↓默认值 background-repeat:no-repeat|repeat-x|repeat-y|repeat; background-color:#000000; # 背景颜色 background-size:300px auto; # 图片大小 # ↓渐变方向 ↓颜色 background-image:linear-gradient(direction,color:rgb(6, 48, 68),color2,color3); # 背景颜色渐变 to top to bottom to left to right to top left to top right to bottom left to bottom right background-position:↑——去掉to (也可以是%|px|其他单位) }