CSS样式属性1

一.大小
width <!--宽度-->
height 高度
二.背景
background-color 背景颜色
background-image 背景图片
background-repeat 背景平铺
background-position 背景图位置居中(必须是no-repeat)
background-size 背景图大小
三.字体
font-family 字体
font-size 字体大小
font-weight 加粗
font-style 倾斜
color 字体颜色
text-decoration:underline 下划线 none是无下划线
text-align 水平对齐
vertical-align 垂直对齐(需配合行高使用)
line-height 行高
text-indent 首行缩进
四.边界和边框
1.边框
border:5px solid blue  分别代表线宽 实线 蓝色
border-top:5px solid blue 其他三边框类似
2.外边距
margin:20px 0px 10px 0px 分别代表上边距 右边距 下边距 左边距
margin-top:10px 上边框间距为10像素
margin:auto 居中
3.内间距
padding 间距  格式同外间距相同
内间距的改变会改变容器大小

4.列表与方块
list-style:none/circle 序号取消/序号变空心圆圈
list-style-image:url(图片地址)  序号变图片
list-style-position:outside/inside 序号在内容外/序号在内容里

 

posted @ 2018-03-19 11:46  w944372441  阅读(86)  评论(0编辑  收藏  举报