Reputation: 4915
I have been using an html table to put 2 block style controls at the same horozontal level in a webpage. What is the best way to do this with css?
Upvotes: 0
Views: 60
Reputation: 13076
Perhaps you can floating the elements would do the trick?
html:
<div id="block1">Block 1</div>
<div id="block2">Block 2</div>
css:
#block1 {
float: left;
}
...of course, this is just a demonstration example...you'd probably want to use a css class instead of hard coding id's...
Upvotes: 1
Reputation: 21466
There are several ways.
The most cross-browser compatible methods are to either float them, position them absolutely, or display inline or inline-block.
The less cross-browser compatible method is to use display: table-cell
.
Upvotes: 0