2014-07-10 73 views
0

鏈接:http://neilson.webege.com/principals.html如何將填充左側添加到已經浮動的文本右側?

我想在圖片和文本之間添加10px的填充。

該文本目前正在浮動。當我試圖在其中一個P類中填充填充物時,沒有任何變化。

任何提示?

<div class="eachprincipal"> 
<img src="images/principalpic.jpg" style="float:left;padding-right: 10px;"> 
<br> 
<br> 
<p style="float:right"> 
</p><p class="principalname"> Jack Zakariaie, J.D. </p> 
<br> 
<p class="principaldescription"> Jack of the house Zakariaie, the First of his Name, King of the Andals and the Rhoynar and the First Men, Lord of the Seven Kingdoms and Protector of the Realm has fed all the starving children in the world by causing photosynthesis in farm plants by reflecting light off his bald head.</p><p></p> 
</div> 
+0

您可以發佈此 – ArtisticPhoenix

+0

鏈接到網頁的HTML和CSS是不優選在這個網站。請在您的問題中包含相關的CSS和HTML。 – SeinopSys

+1

將圖像包裹在它自己的div中並將其填充。單獨的HTML需要清理很多。 – Anagio

回答

1

你正在做它的方式,填充應添加到圖像,而不是段落。

.eachprincipal > img { 
    padding-right: 10px; 
}