CSS网页美化元素

在这里插入图片描述
1 文本样式:color 颜色
text-align 元素对齐方式
text-indet 设置首行文本的缩进
line-height 设置文本的行高
text-decoration 设置文本的装饰
2 字体样式:font-family:“隶书” 字体类型
font-size 字体大小
font-style 字体风格
font-weight 字体粗细
font font:italic bold 36px “宋体”;
在一个声明前设置所有字体属性
list-style-type=none去掉列表前标记符号
3 文本水平居中:
height: 200px;
line-height: 200px;
行高: line-height:px
4 图片水平居中:
vertical-align: middle;display: inline-block;
5 文本装饰:
text-decoration属性
none 默认的标准文本
underline 下划线
overline 上划线
line-through 设置文本的删除线
6 文本阴影:
text-shadow :
color x-offset y-offset blur-radius;
text-shadow:#F00,(0,0,0)
color 颜色 x-offset X轴偏移 y-offset Y轴偏移 blur-radius 阴影模糊半径
7 超链接伪类:
a:link 未单击访问时
a:visited 单击访问后
a:hover 鼠标悬浮上时
a:active 鼠标单击未释放
顺序:l>v>h>a
8 背景颜色背景图像:
background-color 背景颜色
background-image:url(路径) 背景图像
9 背景尺寸:
background-size
auto 默认值 保持原样
percentage 百分值 相对于元素宽度
cover 整个图片放大填充整个背景
contain 让背景图片保持本身的宽高比例,将背景图片缩放到宽度或者高度正好适应所定义背景的区域
10 渐变:
background:linear-gradient(position,color,color);
position 渐变颜色方向
color 两个颜色

发布了31 篇原创文章 · 获赞 0 · 访问量 391

猜你喜欢

转载自blog.csdn.net/weixin_45864941/article/details/103092148
今日推荐