Grow your CSS skills. Land your dream job.

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):

    #header
    {
    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:

    Code:

    What it should look like is:

    Code:

    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.

*May or may not contain any actual "CSS" or "Tricks".