Hey everyone, I'm trying to position a header and a drop down list like this... header dropdownlist ...and i want them to line up correctly, I tried putting them in a Div and just floating the header left and the dropdownlist right, but they don't line up correctly in firefox. Any ideas? Would I be better off just using a table with 2 cells? Thanks!
I tend to be a big fan of tables myself... I feel that it makes it much easier to make websites cross-browser compatible.
Yeah, I agree, I don't think browsers are ready for complete CSS websites yet, but it just seems wrong for me to make a small table with one row to make a header and drop down list align together when most of my other stuff is CSS.
Try this... #nav { margin: 0px auto; border: 0px none; padding: 0; text-align: center; } and then put header & dropdownlist within the nav #header { margin: 0; padding: 0; float: left; } #dropdownlist { margin: 0; padding: 0; float: right; } the total width(header+dropdownlist) mustnot be greater than the width of nav. then put it in the body <div id="nav"> <div id="header"> </div> <div id="dropdownlist"> </div> </div> <!-- nav closed --> It works with fixed width. It''ll be better if you mention the width in the code. hope this'll work ..
Thanks for the help iceberg, unfortunately that didn't work, it looked okay in IE, but then the element under it went right on top of the div.header in Firefox, a few line breaks push it down under. I'm coding this in asp.net so I have a feeling its the markup generated by .net that's messing this up. Thanks for the help, i'll try to figure it out later, 27 hours sitting at my computer isn't helping me solve any problems .