All Posts by Email, Once a Week

Media Temple logo

CSS-Tricks is brought to you in part by Media Temple, the web hosting that we both use and recommend.

Do I suffer from Divitis?

  • # October 18, 2009 at 10:51 pm

    When I want to add an image to my page such as a header i use (example):

    background: url(imagel_src)…

    on the page i use (example):

    <div id="header"></div>

    is there a better way to do this with CSS or is this practice ok?

    # October 19, 2009 at 2:04 am

    Hmmmmm I wouldn’t really consider that Divitis. The fact that you are aware of the term should mean that you also have the ability to steer clear from it.

    One of the most common mistakes I see is something like:


    What it should look like is:


    Both the H1 and UL can be styled just like a div can, a common thing that is overlooked by beginners (and those suffering from Divitis!).

    # October 19, 2009 at 2:14 am

    good. i’m working on cleaning my code up. Is having an empty div like that ok though

    <div id="header"></div>

    I don’t really know any other way to display just an image using css in that context.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed