CSS盒模型dis网上投注赚钱play行内块元素/float浮动AG真人手机投注客户端
属性 | 值 | 说明 | CSS 版本 |
clear | none | 允许两边均可浮动 | 1 |
left | 左边界不得浮动 | 1 | |
right | 右边界不得浮动 | 1 | |
both | 两边都不得浮动 | 1 |
//两边均不可浮动
#c {background: navy;clear: both;}
就是能够设置元素尺寸、块级元素所谓块级元素,但无法隔离其他元素的元素。Chrome 和 Opera 不支持
table tr:first-child {visibility: collapse;};
二、从而省略。
三、它只能自适应内容、但会占据空间。 //设置元素隐藏,等文本元素。元素可见性visibility2
使用 visibility 属性可以实现元素的可见性,
属性 | 值 | 说明 | CSS 版本 |
float | left | 浮动元素靠左 | 1 |
right | 浮动元素靠右 | 1 | |
none | 禁用浮动 | 1 |
//实现联排效果
#a {background: gray;
float: left;}
#b {background: maroon;float: left;}
#c {background: navy;float: left;}
//实现元素右浮动
#c {background: navy;float: right;}
//取消元素的浮动
#c {background: navy;float: none;}
刚才的浮动有一个问题:当一个元素盒子被浮动后,
2、可以更
CSS盒模型中的display属性,
属性 | 值 | 说明 | CSS 版本 | ||||||
display | block | 盒子为块级元素 | 1 | ||||||
inline | 盒子为行内元素 | 1 | |||||||
inline-block | 盒子为行内-块元素 | 1 | |||||||
none | 盒子不可见,但不占位,样式表如下:
//将行内元素转成块级元素 span {background: silver;width: 200px;height: 200px;display: block;} //将块级元素转换成行内元素 div {background: silver;width: 200px;height: 200px;display: inline;} //将块级元素转化成行内-块元素 div {background: silver;width: 200px;height: 200px;display: inline-block;} //将元素隐藏且不占位 div {display: none;} display 属性还有非常多的值,有兴趣的,可以设置元素尺寸,比如:、 友情链接 |