Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 54785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:16:30+00:00 2026-05-10T17:16:30+00:00

Usually when I build a site, I put all the CSS into one file,

  • 0

Usually when I build a site, I put all the CSS into one file, and all the properties that relate to a set of elements are defined at once. Like this:

#myElement {     color: #fff;     background-color: #000;     padding: 10px;     border: 1px solid #ccc;     font-size: 14pt; }  .myClass {     font-size: 12pt;     padding: 5px;     color: #ee3; } 

I’ve been considering splitting up my definitions into a number of different files (colours.css, layout.css, fonts.css …) as I have seen recommended. Something like this:

/* colours.css */ #myElement {     color: #fff;     background-color: #000;     border-color: #ccc; } .myClass {     color: #ee3; }  /* layout.css */ #myElement {     padding: 10px;     border: 1px solid; } .myClass {     padding: 5px; }  /* fonts.css */ #myElement {     font-size: 14pt; } .myClass {     font-size: 12pt; } 

To reduce HTTP requests, I’d be combining the files and stripping whitespace prior to rollout, so that’s not an issue, but my question is: does having all those selectors repeated over and over cause any performance issues in browsers?

Alternatively, are there any tools which avoid this (potential) issue by merging definitions from different files? ie: take the input given in my second example (3 different files), and combine them into one file, like the first example.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:16:31+00:00Added an answer on May 10, 2026 at 5:16 pm

    The browser will have to find all the definitions and then add them up and override the different properties based on the latest definition. So there will be a slight overhead.

    That being said it would be rather minimal and not very noticeable even on hardware 5 years old. The browsers are quite efficient at it these days.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 130k
  • Answers 130k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Here is a simple script that does work on my… May 12, 2026 at 6:03 am
  • Editorial Team
    Editorial Team added an answer This depends on the project and its tolerance for failure.… May 12, 2026 at 6:03 am
  • Editorial Team
    Editorial Team added an answer You need to unpack the libraries into a subdirectory of… May 12, 2026 at 6:03 am

Related Questions

I'm using a pre-compiled ASP.NET 2.0 site (i.e., copied to the server using the
I was just browsing through questions on stack overflow, and i've come up to
Before you answer this I have never developed anything popular enough to attain high
In my current project, I'm producing weekly releases. I've been using the technique described

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.