关于CSS3字体属性整理分析

字体属性:

Font-family: {font-family: name}

{font-family: cursive| fantasy | monospace | serif | sans-serif}

Font-size: {font-size: 数值 | inherit |xx-small | x-small | small | medium | large | x-large | xx-large | larger | smaller | length}

Font-style: {font-style: normal | italic | oblique | inherit}

Font-weight: {font-weight: 100-900 | bold | bolder | lighter | normal}

Font-variant: {font-variant: normal | small-caps | inherit}

字体复合属性font: {font: font-style font-variant font-weight font-size font-family}

font-size和font-family必须在font属性中出现,而且按固定顺序。Font-style, font-variant, font-weight可以自由调换。

字体颜色color:{color: name | rgb | hex | hsl | hsla | rgba}

文本高级样式

阴影文本text-shadow: {text-shadow: none | <length> none | [<shadow>,] * <opacity> 或none | <color> [, <color>]* }

Text-shadow有四个值,第一个值表示阴影的水平位移,可取正负值;第二个值表示阴影垂直位移,可取正负值;第三个值表示阴影的模糊半径,该值可选;第四个值表示阴影颜色值,该值可选。

溢出文本text-overflow用来定义当文本溢出时是否显示省略标记,即定义省略文本的溢出方式。而不具备其他的样式属性定义。要实现溢出时产生省略号的效果还须定义:强制文本在一行内显示(white-space:nowrap)及溢出内容为隐藏(over-flow:hidden)。 {text-overflow: clip | ellipsis}

Clip:不显示省略标记(…),而是简单的裁切条(主流浏览器都支持)

Ellipsis:当对象内文本溢出时显示省略标记(…)(妹啊,Firefox竟然不支持)

控制换行word-wrap:{word-wrap: normal | break-word}

Normal: 控制连续文本换行

Break-word: 内容将在边界内换行,如果需要词内换行(word-break)也可以实现

保持字体尺寸不变font-size-adjust:{font-size-adjust: none | number}

None: 默认值,允许字体序列中每一字体遵守自己的尺寸

Number:为字体序列中所有字体强迫指定同一尺寸

段落属性:

单词间隔word-spacing: {word-spacing: normal | length}

字符间隔letter-spacing: {letter-spacing: normal | length}

文字修饰text-decoration: {text-decoration: none | underline | blink | overline |line-through}

垂直对齐方式vertical-align: {vertical: 属性值}

水平对齐方式text-align: {text-align: sTextAlign}

文本转换text-transform: {text-transform: none | capitalize |uppercase | lowercase}

文本缩进text-indent: {text-indent: length}

文本行高line-height: {line-height: normal | length}

处理空白white-space: {white-space: normal | pre | nowrap | pre-wrap | pre-line}

文本反排unicode-bidi和direction

Unicode-bidi: {Unicode-bidi: normal | bidi-override | embed}

Direction: {direction: ltr | rtl |inherit}

以上就是关于CSS3字体属性整理分析的详细内容,更多请关注其它相关文章!

关于CSS3字体属性整理分析

相关文章:

你感兴趣的文章:

标签云: