Design

Indenting CSS

I was doing an interview this morning, and the canidate was showing me some CSS code, and she had indented the CSS according to the depth of the selectors involved.


table.data_table {
}
    table.data_table tr {
    }
        table.data_table tr td {
        }
    table.data_table tbody {
    }
        table.data_table tbody td {
        }

I'm tried indenting a few stylesheets of mine, and I was surprised at how much more readable the CSS was. I was also surprised that I had never ever once considered indenting the rules as a whole.

8 Replies, Posted May 8th, 2007 at 2:20 pm by Ryan