2010-10-06 85 views
0

爲什麼BESTSELLER這個詞跳過了一行...代碼中沒有任何內容告訴它這麼做? (原諒我 - 這是鏈接http://u.neighborrow.com/CSS行間距問題

 <div class="input text required"> 
       <label for="ItemItem"></label><input type="text" id="ItemItem" value="" maxlength="255" style="font-size: 25px; width: 200px; margin: 5px 0pt;" name="data[Item][item]"> 
       <input type="submit" value="Search" style="font-size: 22px" /> 
      </div> 


      <?php echo $form->end(); ?> 
      Tips: <span style="font-size: 13px; position: relative; top: -2px"> Taking a trip? Want to try something before you buy it? <br > Have a project or event coming up? Want to see who has a copy of that bestseller?</span> 
      <br /> 
      <?= $form->create('Item', array('action' => 'indextest')); ?> 
     </div> 
+1

你可能會嘗試粘貼你發出的代碼,而不是你的源代碼。看看發生了什麼更容易。嘗試包含整個HTML;或者提供一個鏈接來查看它的行動。 – NotMe 2010-10-06 20:55:12

回答

2

我不知道你是什麼意思的「跳過線」。也許鏈接到實時代碼會有所幫助。但我注意到你有更多的關閉div標籤而不是打開。

編輯:它看起來周圍的div有30px的計算行高度。但主題跨度的行高爲18px。所以,當跨度佔據整行時,它顯示在18px行高度。但是,只佔用部分線條時,30px線條高度將應用於該線條的其餘部分,這會導致最後一行顯示在較大的30px線條高度處。嘗試在父div處設置18px行高,或者將span設置爲display:block,以使較大的行高不會在行內顯示。

1

嘗試將顯示:塊添加到您的跨度或替換跨度寬度的任何塊級元素,如<p><div>。在語義世界中,您應該使用<p>;)

此外,您應該嘗試防止內聯樣式。