Grow your CSS skills. Land your dream job.

Semantic Divs

  • # December 10, 2009 at 1:08 pm

    I would like to include some decorative borders on certain elements of my page, but it requires me to create DIVs and insert background images. Is there a more semantic way to do this?

    # December 10, 2009 at 2:49 pm

    By "More Semantic", it sounds like you mean "less html markup" ?

    You don’t have to apply CSS to only <Div>s, if there is already an element there that could have the background image, you can do that. Heck, you can apply the BG image to the <body> and try to position it at the correct spot.

    But besides that, I normally just add the <div>

    box
    # December 11, 2009 at 11:41 am

    There is no semantic way to add meaningless content. You can check to see if you’re utilising all existing block-level elements for you background images. If you do need more, then add more, but don’t go overboard. It’s never ideal to add extra divs, but some complex layouts do occasionally call for it, so it isn’t completely frowned on.

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".