0000標題019

字體間距他是改變字與字的間距和詞與詞的間距的設定,主要是使用word-spacing & letter-spacing 兩個參數,橙覺得比較適合用於英文的方式,至於中文好就還好,有時還是會使用,橙主要是用於標題用,讓文字有點距離,讓使用者看起來有重點的感覺,不過,有時候,就用空白鍵就代替了,但是還是來寫一下使用方式吧!

先寫一段html 吧!

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>魚和橙</title>
</head>
<body>
<h1>Letter-spacing & Word-spacing</h1>
<p id="line1">The results of a survey <strong>keyword</strong> Friday showed <span>that 70 percent</span> of local <em>salaried employees</em> are hesitant(1) about getting married, citing insufficient(2) savings and job instability as the reasons.魚 橙</p>
<p id="line2">The results of a survey <strong>keyword</strong> Friday showed <span>that 70 percent</span> of local <em>salaried employees</em> are hesitant(1) about getting married, citing insufficient(2) savings and job instability as the reasons.魚 橙</p>
<p id="line3"> The results of a survey <strong>keyword</strong> Friday showed <span>that 70 percent</span> of local <em>salaried employees</em> are hesitant(1) about getting married, citing insufficient(2) savings and job instability as the reasons.魚 橙</p>
<p id="line4"> The results of a survey <strong>keyword</strong> Friday showed <span>that 70 percent</span> of local <em>salaried employees</em> are hesitant(1) about getting married, citing insufficient(2) savings and job instability as the reasons.魚 橙</p>
</body>
</html>

 先來看輸出吧!

2012-10-09_141035  

再來就加入css 來看一下吧!

<style type="text/css">
#line1 {
    letter-spacing: 1em;
}
#line2 {
    letter-spacing: 0.1em;
}
#line3 {
    word-spacing: 1em;
}
#line4 {
    word-spacing: -1em;
}
</style>

再來看看結果吧!

2012-10-09_141345   

letter-spacing 是字與字的間距,在#line1 橙設為1em ,所以每個字和字之間的距離拉開了,#line2則是設為0.1em,因設定太小和原本的字間距是相同的。

word-spacing 是單字和單字的間距,相同設為1em ,結果他是每個單字之間拉開了距離,如果設成了負值,就會形成#line4的結果了,應該沒有人會設樣設定吧!

這是office 軟體中,再簡單不過的設定,但是在網頁的設定中,就必須寫上這一段程式,才有辦法讓文字產生變化,有興趣可以試試喔!

arrow
arrow
    文章標籤
    網頁設計 美化文字
    全站熱搜

    雲橙雨林 發表在 痞客邦 留言(0) 人氣()