On Sat, Jun 4, 2011 at 4:29 PM, Keith Purtell <keithpurt...@keithpurtell.com
> wrote:

> This may seem really basic, but I'm trying to figure out best practice
> for stacking DIVs vertically. The first idea I had was a page with two
> fixed-width DIVs inside a wrapper DIV of that same width. I thought the
> second DIV would be forced down. Then I built a test page with three
> sequential DIVs and gave each one a class that set display:block. All
> three stacked up fine. Just to make sure it was the class causing that
> positioning, I disabled the class, and the DIVs remained vertically
> stacked. Does this mean sequential DIVs will inherently each fall into
> position one on top of the other?
>

Yes, that's what DIVs do all on their own. Browsers provide a default
stylesheet that includes (among many other rules):

div { display: block; }

It's interesting to see those default styles. Here's a useful Google search:

http://www.google.com/search?q=browser+default+stylesheet

and here's the actual default stylesheet for WebKit:

http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css

-Mike
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
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/

Reply via email to