I have the following code:
p{
border-right: 2px solid lightgray;
border-bottom: 2px solid lightgray;
padding-right: 5px;
padding-bottom: 5px;
margin: 10px 0;
height: auto;
}
<p><img src="https://lh4.ggpht.com/wKrDLLmmxjfRG2-E-k5L5BUuHWpCOe4lWRF7oVs1Gzdn5e5yvr8fj-ORTlBF43U47yI=w300" style="width: 200px;height: 200px;float:right;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
.</p>
How can I make the borders or rather, the p be made to the size of the content. The borders "go through" the image. But I want the border-bottom to be after the image.
This is a common error that arises when using
float
and the solution in jargon is known asclearfix
In your case you can use:
Example:
He needs to put
<p>
himfloat: left
since the image hasfloat: right;