-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Lineberger, Scott Sent: Tuesday, March 30, 2010 4:21 PM To: '[email protected]' Subject: [css-d] More new to css questions
Ok, I am beginning to warm up to using div's, but perhaps I am being impatient. I was using tables to line up 4 "sections" horizontally, with sections 2, 3, and 4, each containing a form. How do you do that with div? Check this out for a good laugh (or cry?)... http://www.coastalind.com/test2.html 1. As Bill and MB have been shooting back and forth all day, beware of divitis. You've got a bad case of it right here. If there's only one thing in your div, there's a 99% chance that the div is unnecessary. For example, the ones around your forms can all be thrown away without a backward glance. 2. To answer the question at hand, there's lots of ways. The most common is floats, but you could also use absolute positioning, or display:table. Going with floats though, as those are the most straightforward, these make things beneath them float up the page. In your case, for example, after I got rid of those divs, I would put in a rule that's something like this: form { width: 22%; margin: 1em; float: left; } That will make all your forms 22% of the page width, give them a nice margin so they aren't running into each other, and then make them float up next to each other. I'm pressed for time at the moment, so I'll leave you with that, but I might add more later tonight. ---Tim ______________________________________________________________________ css-discuss [[email protected]] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
