tags:

views:

42

answers:

2

I guess I'm wondering if it is ill-advisable to just set:

div {
    overflow: hidden;
}

... instead of worrying about clearing each div. Does anyone else do this or recommend for/against it? Thanks.

EDIT:

I only ask because it seems like I have a handful of divs that require it, at the moment.

+1  A: 

Yes, that will set overflow: hidden for all divs. If you'll find it wrong for some part of your html, then you can disable it for any divs you'll need like this:

/* use default overflow for all divs in specific element */
#some-element-id div {
    overflow: auto;
}

Or you can use classes for this.

Ivan Nevostruev
Thanks. My main question is this a recommended method or not? I honestly don't see the harm, but maybe the pros know something I don't.
Jeff
Well, I don't see anything bad here. Because you can always disable it for the part of html which don't need it.
Ivan Nevostruev
Great, thanks! Just wanted to make sure before I go and hose everything up. =)
Jeff
A: 

It all depends if you want extra content to be hidden by default. My personal preference is only to hide when I know it won't do any harm. Consider a nav menu. If the user is working on a very small screen and you haven't un-hidden the nav menu overflow specifically, then that user won't be able to navigate.

What it comes down to is which is the worse outcome- broken layout or inaccessible content?

dnagirl