Code that refers to the SAME area of your template can be shortened via “css shorthand”, but it must refer to the exact same area. Since you have not included a link to your site it is difficult to determine what can be shortened and what cannot.
well it’s the default theme, so i figured you all had a copy.
I guess I will clarify the above example. There are several sections to the style.css file. There is a typography section for all the lovely text and background formatting. There is also a structure section that deals with the padding, margins, position, etc.
in typography we have this:
#page {
background-color: white;
border: 1px solid #959596;
text-align: left;
}
in structure we have this:
#page {
background-color: white;
margin: 20px auto;
padding: 0;
width: 760px;
border: 1px solid #959596;
}
As you can see there is a bit of repetition with the CSS. That’s just one example among many. Is there a reason that would be there other than to create a nightmare for updating the CSS?
I can strip it all out no problem, but if someone has a cleaner version it would make things a bit easier as the file is nearly 700 lines long, and tracking down redundancies kind of sucks.
No spedific reason for it being that way – just how the original author decided to write it back in 2005 – far as I know its not really been updated since. By segregating it into logical sections he’s also unfortunately left some redundancy and duplication within it.
Just because wordpress ships with it as default doesnt mean anything about it being best practice for CSS (though there’s nothing technically wrong with doing it that way).
Do a search – theres several variations and improvements on it that might suit your purposes.
thanks guys that answers it for me. i know the redundant bits equate to a fraction of a fraction of a second, but somehow i feel better being rid of them.
i figured they could go, but had that nagging “what if” thought.
zeniph- i have done a few searches and looked at several templates. you’re right, there’s a lot out there.