您现在的位置:科汛网络开发 >> 站长充电站 >> div+css >> 浏览文章

2、div+css:边框内容设置
来源:互联网 作者:未知 更新时间: 2009年09月19日 点击:

一 padding

padding用来设置边框中的内容,在没有设置padding属性时,放在边框内的元素都是紧贴边框的。

1 padding-top 顶边距
2 padding-bottom 底边距
3 padding-left 左边距
4 padding-right 右边距

上面四个属性的设置和前面的类似,既可以设置绝对值也可以相对,例如。

padding-top:3px;
padding-bottom:5%;

示例5.1

htm5-1.htm


二 文本设置

1 text-align    用来设置文本水平对齐的方式

(1)text-align:center;居中
(2)text-align:left;左对齐
(3)text-align:right;右对齐
(4)text-align:inherit;继承

2 text-decoration   用来设置文本的强调方式

(1)text-decoration:none;不指定文本效果
(2)text-decoration:underline;下划线
(3)text-decoration:through;中划线
(4)text-decoration:overline;上划线
(5)text-decoration:blink;文本闪烁
(6)text-decoration:inherit;继承

3 text-indent    用来设置首行缩进

(1)text-indent:3pt;绝对值
(2)text-indent:3%;相对值
(3)text-indent:inherit;继承

4 text-transform    用来设置大小写转换

(1)text-transform:capitalize;首字母大写
(2)text-transform:uppercase;所有字母大写
(3)text-transform:lowercase;全部小写
(4)text-transform:none;不使用大小写转换,为默认
(5)text-transform:inherit;继承

示例5.2

htm5-2.htm


三 字间距设置

1 word-spacing  用来设置单词之间的距离,仅对英文有效。

(1)word-spacing:normal;正常值
(2)word-spacing:3pt;绝对值
(3)word-spacing:inherit;继承

2 letter-spacing   用来设置字符的间距

(1)letter-spacing:normal;正常值
(2)letter-spacing:3pt;绝对值
(3)letter-spacing:inherit;继承

htm5-3.htm


设为首页 | 加为收藏 | 关于我们 | 服务条款 | 广告服务 | 免责声明