css文字样式:
font-family:指定字体样式
font-size:字体大小
font-style:指定文本的字体样式 正常(normal)斜体(italic)
font- weight:指定字体粗细
@font-face自定义引入字体
font-variant: small-caps;小型的大写字母
文本样式:
color(文本颜色)
text-shadow:2px 2px 2px red ;文本阴影(属性值:水平方向,竖直方向,模糊度,颜色)
text-decoratuion:line-through underline;文本样式加线
text-transform:capitalize;英语单词首字母大写
text-align:文本对齐方式 左 右 中间
line-height: 50px;竖直方向上居中
背景样式:
background: pink;背景颜色
background-image 把图像设置为背景
background-size 规定背景图片的尺寸
background-size: cover;沾满整个容器 contant
text-align: center;照片完全显示出来
background-repeat 设置背景图像是否及如何重复
left/right/center/bottom/top 这几个属性值可以两两组合使用
background-position: center;背景定位 属性值有两位只写一个的情况下默认是中间
background-attachment: fixed;背景固定
background-clip: border-box; 默认背景位置从边框线开始
background-clip: padding-box; 默认背位置从内填充开始
background-clip: content-box; 位置从内容开始
位置的属性值:
上下 左右
上 左右 下
上 右 下 左
边框样式:
border-style 用于设置元素所有边框的样式
样式:
none 定义无边框。 dotted 定义点状边框
dashed 定义虚线
solid 定义实线
groove 定义 3D 凹槽边框
ridge 定义 3D 垄状边框
inset 定义 3D inset 边框
outset 定义 3D outset 边框
border-color设置元素的所有边框中可见部分的颜色
border-bottom-color 设置元素的下边框的颜色
border-bottom-style 设置元素的下边框的样式
border-bottom-width 设置元素的下边框的宽度
(left,rigtht,top和以上用法相同)
border-image-outset边框图像区域超出边框的量
border-image-width图片边框的宽度
小练习:用边框做出的小红三角代码附上
<div id="san"></div>
#san{
width: 0px;
height: 0px;
border-width: 100px;
border-style: solid;
border-color:transparent transparent red transparent;
}