CSS常见样式

CSS样式
字体类
font-family 表示字体类型
font-variant 表示字体大小写
font-weight 表示字体粗细
font-style 表示字体风格
font-size 表示字体大小
文本类
text-transform:none; 默认状态
text-transform:uppercase; 全部大写
text-transform:lowercase; 全部小写
text-transform:capitalize; 每个单词首字母大写
text-shadow:5px 6px 7px yellow; 表示文本阴影
(5px表示X轴 6px表示Y轴 7px表示模糊度)
文本缩进
text-indent:12px;表示缩进12px
文本装饰线
text-decoration:overline;表示上划线
text-decoration:underline;表示下划线
text-decoration:line-through;表示贯穿线
text-decoration:none;不做改变
文本对齐方式
text-align:center; 居中
text-align:left; 左对齐
text-align:right; 右对齐
行高
line-height:100px; 表示基线之间有100px距离
词间距
word-spacing:30px; 每个词之间的距离为30px
字间距
letter-spacing:30px; 每个字之间的距离为30px
背景
background-image:url(" ") 表示引入背景图片
background-repeat:no-repeat; 表示不平铺
background-repeat:repeat-x; 水平方向平铺
background-repeat:repeat-y; 垂直方向平铺
background-size:cover; 保持图片尺寸,等比例缩放,平铺整个区域,如果图片尺寸大于容器尺寸会超出
background-size:contain;平铺整个区域,图片不会超出容器尺寸(非等比例缩放)
background-position:20px 10px;表示背景图片定位
(20px x轴 向右移动20px)
(10px y轴 向下移动10px)
background-attachment:fixed; 背景图片固定
background-image:linear-gradient(to top,red,...); 表示从下到上的渐变色

posted on 2018-01-01 19:37  为所域为  阅读(97)  评论(0编辑  收藏  举报

导航