PDA

View Full Version : Proper CSS format??



2161
04-10-2007, 07:27 PM
I have been working with CSS on and off and have finally finished formatting my website. I am trying to make sure the format is correct before I do a final update to the site, for one reason is it will make it easier to read if I need to update something later. I am using 4 external style sheets and this is the format I have come up with. Is there any particular order they should be in?? I am just putting part of it up, but it's the order I am going to use unless there is a better one. I am listing them all even though I may not use all of them.

font-family
font-size
color
text-align
margin-top
margin-right
margin-bottom
margin-left
border-style
border-width
border-color
border-top
border-right
border-bottom
border-left
padding-top
padding-right
padding-bottom
padding-left
background-color
width
height

Is this order ok or does it not matter??

Basil
04-10-2007, 08:04 PM
font: size[px] family;
color: #xxx;
text-align: wherever;
margin: top[px] right[px] bottom[px] left[px];
border: width[px] style color;
padding: top[px] right[px] bottom[px] left[px];
background-color: #xxx;
width: ?px;
height: ?px;

The only difference the order makes is that lower declarations override higher ones on the list.

charlesgan
04-11-2007, 02:13 AM
the order doesnt matter.

for each style you created, you can repeat all this inside.
its class property, so define a style as a class :rolleyes:

use dreamweaver to help. much easier.