windbrand
01-06-2012, 08:54 PM
Does anyone know an easy way to display two divs on the same line? The two divs are in a parent div that sets its position. This is the code:
<div id="legend">
<div id="greenbox"></div> <div class="legendtext">= originals</div>
<br>
<br>
<div id="bluebox"></div> <div class="legendtext">= arrangements</div>
</div>
CSS:
#legend {
position:absolute;
float:right;
top:200px;
right:75px;
width:200px;
}
.legendtext {
display:inline;
}
#greenbox {
width:8px;
height:8px;
background-color:#006633;
}
#bluebox {
width:8px;
height:8px;
background-color:#06F;
}
This is how I want it to look, where [greenbox]/[bluebox] is just a 8 pixel colored box by CSS:
[greenbox] = originals
[bluebox] = arrangements
But this is how it appears:
[greenbox]
= originals
[bluebox]
= arrangements
I've tried "display:inline;" and "float", neither works.
<div id="legend">
<div id="greenbox"></div> <div class="legendtext">= originals</div>
<br>
<br>
<div id="bluebox"></div> <div class="legendtext">= arrangements</div>
</div>
CSS:
#legend {
position:absolute;
float:right;
top:200px;
right:75px;
width:200px;
}
.legendtext {
display:inline;
}
#greenbox {
width:8px;
height:8px;
background-color:#006633;
}
#bluebox {
width:8px;
height:8px;
background-color:#06F;
}
This is how I want it to look, where [greenbox]/[bluebox] is just a 8 pixel colored box by CSS:
[greenbox] = originals
[bluebox] = arrangements
But this is how it appears:
[greenbox]
= originals
[bluebox]
= arrangements
I've tried "display:inline;" and "float", neither works.