1.设置大小
width:300px; height:300px;
或
width:20%;height:300px;
2.设置边框
border:1px solid red
dotted虚线,dashed点画线,double双线,ridge脊线)
3.设置轮廓圆滑度
border-radius:50% 50% 50% 50%;
4.定位
相对定位:position:relative;
绝对定位:position:absolute;
left,right,top,bottom
left :200px;或者left:20%;
5.设置背景颜色
background-color:red;
6.旋转
transform:rotate(90deg);
7.水平居中
margin:0 auto;
8.设置显示优先级
z-index:1;用z-index属性时,position必需要指定为absolute才行
9.Float:
Float属性是DIV+CSS布局中最基本也是最常用的属性,用于实现多列功能,我们知道<div>标签默认一行只能显示一个,而使用Float属性可以实现一行显示多个div的功能,最直接解释方法就是能实现表格布局的多列功能。
10.Margin:
Margin属性用于设置两个元素之间的距离。
11.Padding:
Padding属性用于设置一个元素的边框与其内容的距离。
12.Clear:
使用Float属性设置一行有多个DIV后(多列),最好在下一行开始之前使用Clear属性清楚一下浮动,否则上面的布局会影响到下面。
13.!important
指定样式规则的应用优先权
14.font
font:指定DIV中文本的样式,其后可跟文本的多个样式。font-family:设置要用的字体名称;font-weight:指定文本的粗细,其值有bold bolder lighter等;font-size:指定文本的大小;font-style:指定文本样式,其值有italic normal oblique等;color:指定文本颜色;text-align:指定文本水平对齐方式,其值有center(居中) left right justify;text-decorator:用于文本的修饰;其值有none underline overline line-through和blink的组合;text-indent:设置文本的缩进;text-transform:设置文本的字母大小写。其值有lowercase uppercase capitalize(首字母大写) none;direction:内容的流向。其值有ltr(从左至右)、rtl(从右至左);line-height:指定文本的行高;Word-spacing:字间距。
15.overflow
内容溢出控制,其值有scroll(始终显示滚动条)、visible(不显示滚动条,但超出部分可见)、auto(内容超出时显示滚动条)、hidden(超出时隐藏内容)。