Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Classes, Divs, Id's And Managing Them


  • Please log in to reply
5 replies to this topic

#1 webrat

webrat

  • Members
  • 138 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:10:04 PM

Posted 15 May 2008 - 06:30 AM

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

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:03:04 PM

Posted 15 May 2008 - 07:33 AM

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.

#3 webrat

webrat
  • Topic Starter

  • Members
  • 138 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:10:04 PM

Posted 15 May 2008 - 12:07 PM

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

#4 pislkie

pislkie

  • Members
  • 17 posts
  • OFFLINE
  •  
  • Local time:10:04 PM

Posted 17 May 2008 - 05:01 PM

What is the filesize of your external CSS and how many pages are you suporting with it.?
>>>piskie<<<

#5 webrat

webrat
  • Topic Starter

  • Members
  • 138 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:10:04 PM

Posted 18 May 2008 - 08:16 AM

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.

#6 pislkie

pislkie

  • Members
  • 17 posts
  • OFFLINE
  •  
  • Local time:10:04 PM

Posted 21 May 2008 - 05:24 PM

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.
>>>piskie<<<




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users