2011-01-21 123 views
8

我不得不增加正常字體大小句子中間的單詞大小。如何只增加一個字的字體大小?

<p class="call">To book a consultation click here or call NOW</p> 

我怎樣才能擴大在CSS現在這個詞?如果我創建新的段落,這個詞將會轉到新的一行。 任何意見讚賞。

回答

21
<p class="call">To book a consultation click here or call <span class='bigger'>NOW</span></p> 

與CSS

.bigger { font-size:200%; } 
+5

「做大」?真? http://www.w3.org/QA/Tips/goodclassnames – Quentin 2011-01-21 12:45:26

5
  1. 決定爲什麼你希望它是更大(點是HTML是描述語義,而不是演講,所以你需要考慮這種東西)
  2. 寫適當的語義標記
  3. 應用CSS

也許:

<p class="call">To book a consultation click here or call <em>now</em></p> 

,並在樣式表:

em { /* or .call em, but you should aim for consistency in your styling */ 
    font-style: normal; 
    font-size: 120%; 
    text-transform: uppercase; 
} 
相關問題