CSS基础02

一、布局属性
width
描述:设置对象的宽度
语法:width:value;

height
描述:设置对象的高度
语法:height:value;

overflow
描述:溢出的处理
语法:overflow:visible(可见)|hidden(隐藏)|scroll(滚动);

二、边框属性

border-top-width
描述:设置上边框的宽度
语法:border-top-width:value;
border-top-style
描述:设置上边框的线型
语法:border-top-style:none|solid(实线)|dotted(点划线);
border-top-color
描述:设置上边框的颜色
语法:border-top-color:value;

border-top(补P68[2])
描述:设置上边框的属性
语法:border-top:width style color;

border
描述:设置边框的属性
语法:border:width style color;

三、内边距与外边距
3.1 外边距
margin-top
描述:设置顶部的外边距
语法:margin-top:value;
margin-right
描述:设置右侧的外边距
语法:margin-right:value;
margin-bottom
描述:设置底部的外边距
语法:margin-bottom:value;
margin-left
描述:设置左侧的外边距
语法:margin-left:value;

margin(补P70[3])
描述:设置外边距
语法:margin:value(四个方向相同);

margin
描述:设置外边距
语法:margin:上下 左右;
margin
描述:设置外边距
语法:margin:上 左右 下;
margin
描述:设置外边距
语法:margin:上 右 下 左;

padding-top
padding-right
padding-bottom
padding-left
padding
padding
padding
padding

四、盒子模型(BoxModel)

对象的宽度 = 左侧外边距 + 左侧边框 + 左侧内边距 + 宽度 + 右侧内边距 + 右侧边框 + 右侧外边距

五、背景属性

background-color
描述:设置背景颜色
语法:background-color:value;

background-image
描述:设置背景图像
语法:background-image:url(图像URL);

background-repeat
描述:设置背景图像的平铺方式
语法:background-repeat:no-repeat|repeat|repeat-x|repeat-y;

background-attachment
描述:设置背景图像的依附方式
语法:background-attachment:scroll|fixed;

background-position
描述:设置背景图像的位置
语法:background-position:水平 垂直;
水平:left|center|right|value
垂直:top|center|bottom|value;

说明:图像的坐标原点(0,0)位于文档的左上角。
所以,水平向左移动为负值;垂直向上移动为负值。

background(补P73[3])

描述:设置背景属性

语法:background:color url(图像URL) repeat

attachment 水平 垂直;

标准文档流(正常文档流),HTML元素在浏览器
显示的顺序由HTML标记的书写顺序决定。
如果为块级对象则垂直排列;如果为内联对象则水平排列。

六、浮动定位

float

描述:设置对象的浮动

语法:float:left|right;

说明:
A.对象浮动后,将脱离标准文档流。

B.float属性设置为left时,对象将尽量向左移动,
 
  直到父对象的边界或上一个浮动对象的边界为止。

C.当(所有)子对象在方向上存在浮动属性时,其父对象的高度将清除为零。

D.

clear

描述:清除浮动

语法:clear:left|right|both;

七、列表属性

list-style

描述:设置列表样式

语法:list-style:none;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值