web样式大全
Web常用CSS样式大全
一、文字字体样式
-
color 文字颜色
-
font-size 字号
-
font-family 字体
-
font-weight 字体粗细 bold加粗
-
font-style 斜体 italic
-
text-align 水平对齐 left/center/right
-
line-height 行高(单行文字垂直居中)
-
text-decoration 下划线 none去掉下划线
-
text-indent 首行缩进
-
letter-spacing 字间距
二、背景样式
-
background-color 背景颜色
-
background-image 背景图片
-
background-repeat 重复 no-repeat不平铺
-
background-position 背景定位
-
background-size 背景尺寸
三、盒子宽高与间距
-
width 宽度
-
height 高度
-
padding 内边距
-
margin 外边距(margin:0 auto 块级居中)
四、边框样式
-
border 统一边框 粗细 线型 颜色
-
border-collapse: collapse 表格细线合并边框
-
border-radius 圆角
五、布局浮动相关
-
float 浮动 left/right
-
clear: both 清除浮动
-
overflow: hidden 溢出隐藏、清除浮动
六、弹性Flex样式(父容器)
-
display: flex 开启弹性
-
justify-content 水平对齐
-
align-items 垂直对齐
-
flex-wrap: wrap 自动换行
弹性子元素:flex:1 平分宽度
七、文字溢出省略样式
-
white-space: nowrap 文字不换行
-
overflow: hidden 超出隐藏
-
text-overflow: ellipsis 显示省略号
-
-webkit-line-clamp 多行文字折叠
八、鼠标交互伪类样式
:hover 鼠标悬浮样式
九、显示隐藏样式
-
display: none 完全隐藏,不占位置
-
visibility: hidden 隐藏,保留原有空间
十、列表清除样式
list-style: none 去掉列表圆点

浙公网安备 33010602011771号