2014-07-10 71 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; 
}