开发者

Is there a better alternative to Line Break

开发者 https://www.devze.com 2023-01-20 13:05 出处:网络
Sometimes after a <div> class the next line comes on the same line and I need to put say 10 <br> to get it to the next line.

Sometimes after a <div> class the next line comes on the same line and I need to put say 10 <br> to get it to the next line.

Is this okay or is there an alternative to this?

开发者_如何学运维

Everything works out fine, it's just that I need to put 10 <br>. Is this normal?

Thank You

GOT IT TO WORK USING CLEAR:BOTH. THANKS.


You need to clear after your floating elements. Put this after the elements:

<div style="clear:both"></div>
<!-- Now you won't need <br/> to display text here -->


No this is not normal


Ok, I think I understand what you mean...

<div style="float:left"> some text here... </div>

<div> some other text ... </div>

If you want the second DIV to be pushed below the first DIV, you have to set its clear property to left:

<div style="float:left"> some text here... </div>

<div style="clear:left"> some other text ... </div>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号