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

  • Home
  • SEARCH
  • 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 45897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:52:52+00:00 2026-05-10T15:52:52+00:00

I just finished a medium sized web site and one thing I noticed about

  • 0

I just finished a medium sized web site and one thing I noticed about my css organization was that I have a lot of hard coded colour values throughout. This obviously isn’t great for maintainability. Generally, when I design a site I pick 3-5 main colours for a theme. I end up setting some default values for paragraphs, links, etc… at the beginning of my main css, but some components will change the colour (like the legend tag for example) and require me to restyle with the colour I wanted. How do you avoid this? I was thinking of creating separate rules for each colour and just use those when I need to restyle.

i.e.

.color1 {     color: #3d444d; } 
  • 1 1 Answer
  • 1 View
  • 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-10T15:52:53+00:00Added an answer on May 10, 2026 at 3:52 pm

    That’s exactly what you should do.

    The more centralized you can make your css, the easier it will be to make changes in the future. And let’s be serious, you will want to change colors in the future.

    You should almost never hard-code any css into your html, it should all be in the css.

    Also, something I have started doing more often is to layer your css classes on eachother to make it even easier to change colors once… represent everywhere.

    Sample (random color) css:

    .main_text {color:#444444;} .secondary_text{color:#765123;} .main_color {background:#343434;} .secondary_color {background:#765sda;} 

    Then some markup, notice how I am using the colors layer with otehr classes, that way I can just change ONE css class:

    <body class='main_text'>   <div class='main_color secondary_text'>     <span class='secondary color main_text'>bla bla bla</span>   </div>   <div class='main_color secondary_text>     You get the idea...   </div> </body> 

    Remember… inline css = bad (most of the time)

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

Sidebar

Related Questions

Just finished read this post by Greg Young, where he is talking about Microsoft
I just finished a test as part of a job interview, and one question
I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after
I've just finished my Android widget. Now I need to have different sizes of
Just finished a little app that I want to distribute and at the moment
Just finished reading Crockford's JavaScript: The Good Parts and I have a question concerning
I've just finished reading 'Java for Dummies' and have begun to create a simple
I have just finished a client’s website and now they want to have different
I have just finished incorporating a jQuery accordian with a jQuery Slider. I.e. 3
So I just finished development of a prototype of my MVC site. It uses

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.