CSS 属性

1.属性

分类

属性

内容

示例

备注

重复

背景

background-color

背景色

background-color: gray ;

padding

背景色向外延伸

padding: 20px ;

2

background-image

背景图片

background-image: url(bk.jpg) ;

background-repeat

平铺

background-repeat: no-repeat ;

background-position

位置

background-position: left top ;

2个值left top 用空格分开, % , 100px, 

background-attachment

滚动

background-attachment: fixed ;

文本

text-indent

第一行缩进

text-indent: 4em ;

可以是 %, 相对于父元素的%

text-align

文本对齐方式

text-align: center ;

2

word-spacing

单词之间的间隔

word-spacing: 30px ;

letter-spacing

字母之间的间隔

letter-spacing: 10px ;

text-transform

字符转换

text-transform: uppercase ;

uppercase大写,lowercase小写,capitalize首字母大写,none没转换

text-decoration

文本装饰

text-decoration: underline ;

none,underline,overline,line-through

字体

font-family

通用字体系列

font-family: sans-serif;

特定和通用结合 font-family: sans-serif, serif ;

font-style

字体风格

font-style:italic ;

font-variant

小型大写字母

font-variant:small-caps ;

font-weight

字体加粗

font-weight: bold ;

font-size

字体大小

font-size: 40em ;

推荐使用em单位

列表

list-styly-type

列表前边小项式样

list-style-type: square ;

ul li { list-style-image: url(xxx.gif)}

表格

border

表格边框

border: 1px solid blue ;

width

表格宽度

width: 50px ;

height

表格高度

height: 50px ;

vertical-align

垂直对齐方式

vertiacal-align: bottom ;

text-align

水平对齐方式

text-align: center ;

2

padding

表格边框到内容的距离

padding: 15px ;

2

background-color

背景颜色

background-color: black ;

2

color

字体颜色

color: white ;

 

2.图

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值