您的位置:首页 > Web前端 > CSS

浅谈css样式(border、background、table)

2015-09-21 23:33 525 查看
border用法

border:边框。属性有:border-width,border-style,border-color。

<div id="d1">
高度200,宽带200,边框颜色为红色的边框。
</div>


#d1{
width:200px;
height:200px;
border:1px solid red;
}


border-width:表示边框的粗细。border-style:边框样式。solid实线。dashed虚线。dotted:点线。border-color:边框颜色。

举例说明

#d1{
width:200px;
height:200px;
border:2px dashed red;
}


网页背景(background)

网页背景设置属性有:background-color:背景颜色。background-image:背景图片。background-position:背景图像的位置。background-attachment:fixed;规定背景图像是否固定或者随着页面的其余部分滚动。

举例说明:

<div id="d2">
背景小图标设置
</div>


#d2{
width:14px;
height:14px;
margin:0px;
padding:0px;
background-image:url(../image/iconNew.png);
background-position:left -50px;
background-attachment:fixed;
}


表格(table)

边框会合并为一个单一的边框。

table{
width:300px;
height:400px;
border:1px solid #ccc;
border-collapse: collapse;/*合并边框*/
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: