css中的文字屬性

2021-10-02 05:36:26 字數 1495 閱讀 7791

/設定字型/

/font-family: 「楷體」;/

/*字型大小

預設是16px */

font-size: 30px;

/* font-style: 字型樣式;

normal : 正常 (預設);

italic : 斜體;

oblique: 傾斜;

*//font-style: oblique;/

/*字型加粗: font-weight

bolder: 特粗體;

bold: 加粗體;

normal: 正常 (預設);

lighter: 細體; */

/font-weight: lighter;/

/單詞間隔/

word-spacing: 20px;

/字母間隔/

letter-spacing: -10px;

/*首行縮排

例如span 之類只憑藉內容撐開大小的標籤,無法使用

例如div,p 之類獨佔一行的標籤,可以使用

em: 大小的單位             

父元素的字型大小 = 1em

em也是乙個相對單位 */

text-indent: 2em;

/*文字裝飾

text-decoration

none;正常顯示

underline;加下線

line-through;刪除線

overline;加頂線 */

text-decoration: underline solid pink; }

/* capitalize:首字母大寫

uppercase:全部大寫

lowercase:全部小寫 */

/text-transform: lowercase;/

font-family: 設定文字的字型

font-size: 設定字型大小

font-style : 設定文字的傾斜效果

normal 正常

obilque 偏斜體

italic 斜體

font-weight : 設定文字加粗效果

normal 正常粗細

bold 比正常粗

border 比bold粗

lighter 比正常細

color : 設 置顏色

background-color: 設定文字與背景顏色

word-spacing : 單詞間距語句間距

letter-spacing: 字母間距文字距離

text-indent : 設定段落首行縮排

text-decoration : 文字裝飾效果t

ext-transform: 英文本母大小寫轉換

vertical-align : 垂直對齊方式

line-height : 設定段落的垂直對齊方式

text-align : 設定文字水平位置

CSS文字屬性

一 可以被繼承的屬性 font size font family font weight font style line height color text align text indent 二 文字大小 屬性值為數值型,必須給屬性值加單位,屬性值為0時除外。單位可以是pt px em 9pt 1...

CSS 文字屬性

1 縮排文字 text indent 3em 段落首行縮排給定長度 只應用於塊級元素,無法將這個屬性應用與行內元素。影象之類的替換元素上也無法應用text indent屬性。可以繼承 如果要設定成負值,為了防止超出邊界,建議的寫法如下 p2 水平對齊 text align left center r...

css 文字屬性

字型顏色color 字元間距letter spacing 文字背景色background color 行間距line height 90 10px,0.3 對齊文字text align 文字修飾text decoration 取值 overline line through underline bl...