Help - Search - Members - Calendar
Full Version: Classes, Divs, Id's And Managing Them
BleepingComputer.com > Internet & Networking > Web Site Development
   
webrat
Hey folks,

OK, so I've eaten about a dozen CSS manuals and topped it off with a few HTML handbooks for good measure, so I get the basics. My question is relatively simple.

I'm currently coding my first website and am largely using specific element ID's or small Divs for maximum control of the design and it's really starting to take shape, but given the amount of code I'm generating I'm beginning to wonder if there is a better way. Does anyone have experience of grouping seemingly random elements into classes that make sense? I'm starting to realise that even though I'm using an external stylesheet the end result may be a sheet larger than the rest of the site and it's a bit of a worry as I don't know at what point this would start to affect performance. If anyone has any thoughts on this type of issue I'd appreciate it.

Cheers

Jason
groovicus
QUOTE
I don't know at what point this would start to affect performance


When your style sheet is about a million lines long, then you may want to worry about it, but the only thing that is going to be effected is the initial load time. The style sheet for Bleeping Computer is 80 pages long when posted into a word document.
webrat
I thought it would be a fair bit but a million lines of code.....

So, basically, if I keep it tidy and if at some stage I can actually get my head round inheritance to strip it down a bit it's no problem. That's definitely worth knowing.

Cheers

Jason
pislkie
What is the filesize of your external CSS and how many pages are you suporting with it.?
webrat
Hey Pislkie,

It's only about 300k ATM but it's supporting around 15 pages currently and that may go up by another couple (it's a joint site for me and my other half for various uses). The HTML for each of the basic pages is neither here nor there.

Based on my near-complete frontpage code I'm expecting a 10x increase in filesize, maybe more. It's not so much the size now I'm concerned about but the rate it's increasing, the only file that is growing at a similar pace is my image file which I'm being pretty ruthless with. I've only got 55mb to play with overall if I want to keep it free (which I do) so I figured I'd start thinking about it now.
pislkie
300k is massive for a CSS file IMO. my external CSS files run between 3k and 20k. I start to look at rationalisation when the size hits double figures. You can run into massive CSS if you let things get out of hand and don't have the right policy from the outset. If you can show me the CSS file, I would be glad to have a quick peep at what is going on. Maybe you could PM me the address of your CSS file.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.