« The 2004 Christmas Card | Main | A landlord's horror story...oh my! »
December 20, 2004
Small CSS Eureka
I thought of this small css tip. The more I thought about it, the more it made sense.
Here it is.
Heavy css use implies the use of a lot of images. These are called through css. Create a directory structure within a styles directory. Doing so will allow the css system to be more self-contained for the webmaster. This might help increase portability. It might speed execution (my conjecture).
Any way, I did it such as:
.categoryMain {
background: #fff url(i/c.jpg) 0px 0px no-repeat;
padding: 15px;
}
But why even use subdirectories?
Continuing on this thought, why even use a subdirectory. Just place the images in same directory as the css file. Now you have a cleaner path for subsequent DOM moves. So now its:
.categoryMain {
background: #fff url(c.jpg) 0px 0px no-repeat;
padding: 15px;
}
Its still portable. You case rename the root directory to whatever later. I've always seemed to bumble my way around, especially calling images with css. This makes it simpler.
Posted by pgraber at December 20, 2004 06:55 PM
