+ Reply to Thread
Results 1 to 4 of 4

Thread: Practicing CSS via View Source

  1. #1
    Dee
    Dee is offline Supreme Babbler Dee is a reputable WB member and has over 100 reputation points Dee is a reputable WB member and has over 100 reputation points
    Join Date
    Jun 2009
    Location
    USA
    Posts
    993

    Default Practicing CSS via View Source

    Lately, I've been looking at the CSS used by sites I like and playing around with them in Firebug. (such a cool tool)

    I decided to get the code at CSS Zen Garden and play around with it. I'm still learning, so I don't know when something is right or wrong, but say, maybe 2% of the time. Anyway, I noticed the HTML had all these divs with spans inside them. Nothing else. Just divs like the following:
    Code:
    <div id="extraDiv1"><span></span>
    That couldn't be right, could it?

    Also, is there such a thing as having too many divs? And what's the order that divs are called by the browser? Is it right to left, top to bottom, zig zag??
    Do you need help setting up Wordpress and/or the Thesis theme?
    Do you need help with writing or editing content?
    I can help. Low Fees. PM me.

  2. #2
    Ron
    Ron is offline Master Babbler Ron has more than the average amount of reputation points
    Join Date
    Dec 2009
    Location
    Newberg, Oregon
    Posts
    274

    Default

    Yes it is correct. There will be a style.css file that is loaded at the top of the page. It will look something like:

    <link rel="stylesheet" href="style.css" TYPE="text/css">

    In the style.css, you will find the bulk of the style properties.

    Hope this helps,
    Ron

  3. #3
    Dee
    Dee is offline Supreme Babbler Dee is a reputable WB member and has over 100 reputation points Dee is a reputable WB member and has over 100 reputation points
    Join Date
    Jun 2009
    Location
    USA
    Posts
    993

    Default

    Hey Ron...I don't understand your response, because that wasn't my question. Care to elaborate?
    Do you need help setting up Wordpress and/or the Thesis theme?
    Do you need help with writing or editing content?
    I can help. Low Fees. PM me.

  4. #4
    meloncholy's Avatar
    meloncholy is offline Master Babbler meloncholy has an outstanding reputation at WB (over 500 points) meloncholy has an outstanding reputation at WB (over 500 points) meloncholy has an outstanding reputation at WB (over 500 points) meloncholy has an outstanding reputation at WB (over 500 points) meloncholy has an outstanding reputation at WB (over 500 points) meloncholy has an outstanding reputation at WB (over 500 points)
    Join Date
    May 2009
    Site
    www.poleexercise.co.uk
    Posts
    310

    Default

    CSS Zen Garden is coded like that to give as many options to designers as possible. If you look at the stylesheets for different designs you'll find that the authors make use of some of the 'extra' divs or spans to get the effect they want (perhaps adding illuminated first letters as images or a fancy border).

    Obviously this isn't a great way to code up your own site as it's very wasteful - as you're writing the CSS and HTML yourself, you can limit it just to the tags you need.

    Also, is there such a thing as having too many divs? And what's the order that divs are called by the browser? Is it right to left, top to bottom, zig zag??
    I don't think there are any problems with too many divs (other than excess file size of course), though it's possible some old version of IE would complain. HTML elements aren't called in any order: they're just there. Unlike, say, JavaScript or PHP, they aren't executed, so there's no need to specify which one comes first. I guess it's a bit like a still life of fruit: some of the grapes will be next to each other and the grapes will be inside the bowl, but there's no first grape.

    Of course that doesn't stop us from doing things to the divs in some order. We may choose to iterate through them with JavaScript and access or modify them somehow. We could do that in any order, though the element relationships in JavaScript makes some orders (depth first, basically) much easier to do than others.
    Pole Exercise - Pole dancing evolved
    meloncholy - A state of mind brought about by eating too much soft fruit

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts