2011-01-21 37 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; 
}