样式属性

来源:互联网 发布:网络吃饼干是什么意思 编辑:程序博客网 时间:2024/04/30 23:07

字体

@font-face {属性取值;}

font-family: 设置文本的字体名称。 

font-style: 设置文本样式。 

font-variant: 设置文本是否大小写。 

font-weight: 设置文本的粗细。 

font-stretch: 设置文本是否横向的拉伸变形。 

font-size: 设置文本字体大小。 


src: 设置自定义字体的相对路径或者绝对路径,注意,此属性只能在@font-face规则里使用。 

背景

background-origin : border | padding | content 

border: 从border区域开始显示背景。 

padding: 从padding区域开始显示背景。 

content: 从content区域开始显示背景。 

background-clip : border-box | padding-box | content-box | no-clip

 

border-box: 从border区域向外裁剪背景。 

padding-box: 从padding区域向外裁剪背景。 

content-box: 从content区域向外裁剪背景。 

no-clip: 从border区域向外裁剪背景。 

background-size [ <length> | <percentage> | auto ]{1,2} | cover | contain 

 

<length>: 由浮点数字和单位标识符组成的长度值。不可为负值。 

<percentage>: 取值为0%100%之间的值。不可为负值。

background : [background-image] | [background-origin] | [background-clip] | [background-repeat] | [background-size] | [background-position]

<background-image>: 指定或检索对象的背景图像。 

<background-origin>: 指定背景的显示区域。参见background-origin 

<background-clip>: 指定背景的裁剪区域。参见background-clip 

<background-repeat>: 设置或检索对象的背景图像是否及如何重复铺排。 

<background-size>: 指定背景图片的大小。参见background-size 

<background-position>: 设置或检索对象的背景图像位置。 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Content-Language" content="utf-8" /><meta name="robots" content="all" /><meta name="author" content="Tencent-ISRD" /><meta name="Copyright" content="Tencent" /><title>Border-radius</title></head><body><div style="background-image: url(img/multiple-backgrounds.png), url(img/multiple-backgrounds.png), url(img/multiple-backgrounds.png); background-position: left top, -320px bottom, -640px top;background-repeat: no-repeat, no-repeat, repeat-y;width:260px;padding:20px;"> <p>这是一个宽为300px,高度自适应的多背景示范容器,完成的一个九宫格模型</p> </div></body></html>



 文本

text-shadow : none | <length> none | [<shadow>, ] * <shadow> none | <color> [, <color> ]*

<color> : 指定颜色。 

<length> : 由浮点数字和单位标识符组成的长度值。可为负值。指定阴影的水平延伸距离。 

<opacity> : 由浮点数字和单位标识符组成的长度值。不可为负值。 指定模糊效果的作用距离。如果你仅仅需要模糊效果,将前两个 length 全部设定为 

text-overflow : clip | ellipsis

clip: 不显示省略标记(...),而是简单的裁切。 

ellipsis: 当对象内文本溢出时显示省略标记(...) 

word-wrap : normal | break-word

normal: 控制连续文本换行。 

break-word: 内容将在边界内换行。如果需要,词内换行(word-break)也会发生。


 

在css中设置div居中显示:
margin-left: auto;
margin-right: auto;

0 0
原创粉丝点击