Use a <table>
, they are the best for side-by-side alignments in my experience
views:
4398answers:
3
A:
Click Upvote
2009-04-15 13:17:12
It actually was <table>, however with all the trends around changing tables to divs I though I might follow the crowd and switched it to tabless (as one of the tags for the question implies) :)
turezky
2009-04-15 13:24:11
That wouldn't be semantically correct as there's no tabular data to be displayed.
Calvin
2009-04-15 13:43:31
Why fight the system? Tables are the best when it comes to side by side alignment in web pages. I know it shouldn't be this way, but that's just the way it is. See: http://stackoverflow.com/questions/591539/forms-can-they-be-done-without-tables
Click Upvote
2009-04-15 14:22:27
A:
Dont use a table! i often use an unordered list for long forms. but here 2 divs may work. Make sure that for accessibility you have the Ara: marked up as a <label>
and you associate it with the input field
make sure that you have reset the default padding and margin for the items before expressing yours.
#box label, #box input {margin:0;padding:0;}
nickmorss
2009-04-15 13:28:15
+2
A:
Some content here 2
What's that content? Your example works as-is, so it's something in the content itself that causes the issue.
Does it perhaps include a form, as it looks like on the shot?
<form> has a default top/bottom margin, and how vertical margins collapse is a matter of some confusion and browser differences (it's usually best avoided if possible). So the mini-reset rule:
form { margin: 0; }
may help.
bobince
2009-04-15 14:15:43