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 779299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:54:27+00:00 2026-05-14T19:54:27+00:00

I’m trying to implement the following feature: I want just one css file to

  • 0

I’m trying to implement the following feature:

I want just one css file to be attached for any page that I rendered. For example take StackOverflow site. For the questions page, we will have questions.css file.

so.com/questions              --->    questions.css
so.com/question/1234/title    --->    question.css
so.com/about                  --->    about.css
so.com/faq                    --->    faq.css

Now, I know that this css files share code in common, because they may have the same MasterPage(s) / UserControls. So, the solution need to take into account MasterPages, views and usercontrols as well.

So, what will be the right solution for this kind of problem?

I’m thinking about one solution, I’ll put is as an answer, but maybe you have a better solution for this?

  • 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. Editorial Team
    Editorial Team
    2026-05-14T19:54:28+00:00Added an answer on May 14, 2026 at 7:54 pm

    EDIT: Since this is the accepted answer and still gets reads: Do look at it through a historic lens. What was valid in 2010 is likely no longer the recommended approach in whatever year you’re reading this.


    But why would you do this?

    One of the reasons to use CSS is to have everything in one place, instead of scattered around.

    If you need very different styles to the different views, you could just as well put a unique ID in the body tag on each view (<body id="index">), and then use selectors like #index #subnav a to set explicit styles to that view. This way, you can have everything in one stylesheet, and it will still give you different looks across pages, while easily sharing the common styles. One large stylesheet with this will probably be more efficient than new HTTP-requests per sub-page, performance-wise, and it will save you a lot of work when you need to change stuff.

    A different approach would be to include two (or more) stylesheets on the page, where one contains all the common styles, and the other one is unique per view in some way.

    If I were in your position, I’d easily have made one big stylesheet. Simplifies everything so much.

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

Sidebar

Related Questions

No related questions found

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.