tags:

views:

78

answers:

3

Hey guys,

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.

+2  A: 

No this is not normal

Yarek T
I disagree. Since it is happening, it is true, ergo, normal.
Šime Vidas
How would you know its happening ? So far I have not seen a shred of supporting evidence =)
Yarek T
Hehe. Well, something IS happening. And the OP asked if that (what is happening) is normal. I would say so. (Unless someone hacked his browser)
Šime Vidas
LOL you got an upvote for that answer.
Šime Vidas
+2  A: 

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>
Šime Vidas
Yep, it worked. Thank you so much.
jack
+5  A: 

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 -->
Splashdust
Oh my god! Amazing. It worked. Thanks
jack
+1 for guessing correctly ;)
Yarek T
+1 for beating me by 16 seconds :)
Šime Vidas
@jack, since this worked for you, consider marking it as the "accepted" answer by clicking the hollow checkmark under the voting arrows.
Lord Torgamus