Same Line Div Tags
Sorry to ask such a stupid question, but it's been quite a long night and I cannot seem to get my code to display the divs on the same line. I've searched all over Stack Overflow a
Solution 1:
.hbox, .mbox {
box-sizing: border-box;
-moz-box-sizing:border-box; /* Firefox */display:inline-block;
}
Solution 2:
Add float:left
to both .mbox and .hbox.
Solution 3:
I take it you need the two divs inside <div class="sameline">
to appear next to each other
so a css rule like
.hbox, .mbox {float:left}
Should do it
Solution 4:
Just add .sameline div {float: left;}
.
(BTW, try to avoid posting PHP when asking CSS/HTML questions, as it makes it harder to read/interpret the code‚though not too difficult here. Get the HTML from your browser's source code, if necessary.)
Also note that sameline
is a class, so this won't work unless you change the #
to a .
:
#sameline {
overflow: hidden;
white-space: nowrap;
}
Solution 5:
if you add float: left;
to .mbox
and .hbox
it should work.
Example here.
Post a Comment for "Same Line Div Tags"