Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Multiple stylesheets or just 1 big one

Featured Replies

Is it best to have 1 stylesheet that has all the styling for the whole site in it, or is it best to split them up to specific files and then have the different pages link to the relevant stylesheets that are needed?

 

On the W3C validation it says that it can speed up the site by not using unnecessary code for different pages.

Your best bet would be to keep them as well-commented sections in one CSS file. The main hit for performance is HTTP requests, so if you're only making one for all your CSS that's the most efficient way. Don't forget that the CSS file is only downloaded for the first page requested on your site, any future requests are directed to your browser's cache.

Edited by Renaissance-Design

As of my opinion it's good to have a single style sheet for the css coding. As it's easy to manage while at the time of when you need to make any changes to specific location. And to have specific comment in the sheet is most important thing.

I second (or third!) having one sheet, as renaissance said it will cache the file anyway so you'll only have to download it once. The only time I would have multiple sheets is if you have a huge site with a multitude of different sections that are styled differently (in which case you can break it into separate ones).

Your best bet would be to keep them as well-commented sections in one CSS file. The main hit for performance is HTTP requests, so if you're only making one for all your CSS that's the most efficient way. Don't forget that the CSS file is only downloaded for the first page requested on your site, any future requests are directed you your browser's cache.

 

Bang on bullseye there. More sharp-shootin' by Renaissance.

It's certainly difficult if someone posts a query in this forum and you find that they have ten stylesheets, plus alternative stylesheets and some more in IE conditional comments. You fill up your task bar with all those for editing and soon get confused.

 

However, I do sometimes use more than one stylesheet, usually for something with very separate code like a special menu which I may use on several sites, or for @font-face font formats. It makes it easier to go straight to the code you want without searching down a long stylesheet. Some people use a separate stylesheet for Meyer's reset but I put that at the top of my main stylesheet.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.