Forums

  • # September 14, 2008 at 12:40 am

    My question is how set dreamweaver for writing single line css. when it writes .via properties panel

    # September 23, 2008 at 4:51 pm

    It’s good to hear that the standard seems to be that there is no standard. After looking at many examples of how people lay out their style sheets, I came to the decision long ago to use a combination of both styles depending on which is the most readable (to me) for the given tag.

    Along those lines I also add whitespace:

    Code:
    P.main { color: #000000; text-align: left; }

    opposed to:

    Code:
    P.main{color:#000000;text-align:left;}

    and indent two spaces when using the other format:

    Code:
    P.main {
    color: #000000;
    text-align: left;
    }

    I’m sure that there must be an impact on loading time but I would hope it is negligible. Imo, the time the readability saves me is well worth a minor hit in file size.

    # September 25, 2008 at 10:20 pm

    I think one line CSS is easier to organize. For example:

    Code:
    /*- – – – – – – – – –
    Contents
    ——————–
    AA01. Header
    AB01. Content
    ——————*/

    /*- – – – – – – – – –
    AA01. Header
    ——————*/
    #header { background-color: #000; width: 500px; }
    #header.logo { background: transparent url(logo.gif) no-repeat; float: left; }
    #header.search { float: right; padding: 5px; }
    /*- – – – – – – – – –
    AB01. Content
    ——————*/
    #content { border: 3px solid #000; width: 500px; }
    #content.sidebar { float: left; width: 100px; }

    As you can see, I also create a table of contents at the top of my CSS file, complete with unique call numbers for each section of my css so anyone can find what they want using CTRL+F. And I organize my selectors alphabetically. OCD? Maybe, but it helps me.

    # September 26, 2008 at 12:42 am

    Wow, that’s a very handy tip. Saves going through it manually. Good work.

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

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag