首頁 > web前端 > css教學 > 主體

關於CSS3字體屬性整理分析

高洛峰
發布: 2017-03-27 18:28:54
原創
1500 人瀏覽過

 字體屬性:

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 xx-large | | 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 | none | [,] *  或none | [, ]* }

##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-bididirection

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

Direction: {direction: ltr | rtl |inherit}

##########

以上是關於CSS3字體屬性整理分析的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!