Think like a programmer while writing CSS

Hack your OS, customize your GUI, announce great software, and configure, configure, configure...
Post Reply
SOD
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 5284
Joined: 12/06/01, 12:00 am
Location: here and there

Think like a programmer while writing CSS

Post by SOD » 11/19/06, 10:58 am

heh: Just figured out how to do a two column float
without hacks or conditionals. There is a way to write CSS so that the logic of the syntax scheme is congruent.

More later... this is cool.
It is better to be here than there - SOD

Gerry
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 5727
Joined: 12/04/01, 12:00 am
Location: Perth, Western Australia
Contact:

Post by Gerry » 11/19/06, 3:42 pm

Not really sure what you are talking about, but a posting of some code would probably help.
I answer rhetorical questions for my own enjoyment.

SOD
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 5284
Joined: 12/06/01, 12:00 am
Location: here and there

Post by SOD » 11/20/06, 12:26 am

I write CSS so that it is expict to the parent element
this could be implied but just like CSS shorthand implied hierarchy of CSS fails sometimes. So I write boilerplate.

Code: Select all


#left p{
some code
}

#right p{
some code
}

I never attempt to use padding or margin at the parent element either. I have found that best case results
happen when you apply margin or padding to the child. In this case it is the 'p' element. This eliminates complex interaction. Maybe this is common practice but it really takes box model interaction out of the picture. Not only that CSS is easily maintained and relational
to the XHTML.
It is better to be here than there - SOD

SOD
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 5284
Joined: 12/06/01, 12:00 am
Location: here and there

Post by SOD » 11/21/06, 8:58 am

Gerry was this to obvious? It just decouples interaction.
It is better to be here than there - SOD

Gerry
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 5727
Joined: 12/04/01, 12:00 am
Location: Perth, Western Australia
Contact:

Post by Gerry » 11/21/06, 2:52 pm

Umm do you have an example of where you have applied this?
I answer rhetorical questions for my own enjoyment.

Post Reply