I have two elements I want to put next to each other, and three elements I want to put below the first two, like this:
Element 1 Element 2
Element 3 Element 4 Element 5
These are text elements actually, and no matter how long the text might be, I want them to still stay in that position. How do I do this without using   ?
Use <div>
tags to create two different containers.
<div>
Element 1 Element 2
</div>
<div>
Element 3 Element 4 Element 5
</div>
If it's a text use <br>
for this. Write like this:
Element 1 Element 2 <br>Element 3 Element 4 Element 5
& if it's HTML elements. Write like this:
HTML
<div>element1</div>
<div>element2</div>
<div class="ele3">element3</div>
<div>element4</div>
<div>element4</div>
CSS
div{
float:left;
margin-right:5px;
}
.ele3{
clear:both;
}
Check this http://jsfiddle.net/K9Smv/
<div>
element1
element2
</div>
<div class="new_line">
element3
element4
element5
</div>
<div class="new_line">
element6
element7
element8
element9
</div>
div{
float:left;
margin-right:5px;
}
.new_line{
clear:both;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With