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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:26:36+00:00 2026-05-17T01:26:36+00:00

My understanding about CSS is that, generally if you set <div style=color: Red> ,

  • 0

My understanding about CSS is that, generally if you set <div style="color: Red">, all content inside <div> will be affected. However if you put a html button inside, the color on the words on the button is not affected. I’m a bit disturbed by this exception. How do I give a reasonable explanation to it?

  • 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-17T01:26:36+00:00Added an answer on May 17, 2026 at 1:26 am

    The “cascading” part of “Cascading Style Sheets” (CSS) means that in general, you’re right: a property set on an object will cascade down to objects below it.

    However for some properties this doesn’t make sense, so those properties are explicitly non-cascading (eg if you set a border on a div, you don’t want all its children to have borders as well).

    If we were dealing with raw XML in our DOM, that’s where it would end. The colour would indeed cascade all the way down. However, we’re dealing with HTML, and HTML has some pre-existing conditions, exceptions and overrides. For example, a <div> always defaults to display:block; whereas a <span> will default to display:inline;.

    Buttons and input fields have a lot of defaults and overrides, which is why they show up as buttons and input fields without you having to do loads of styling on them. This is also why they override the cascading effect of certain CSS rules, including color.

    You can override the override by specifying inherit for the overridden styles. So if you want you button to take the red colour you specified previously, you would do something like this:

    .mybutton {
        color:inherit;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked online about this. So my understanding is that AdapterContextMenuInfo.position is the
I have only a basic understanding of Eclipse RCP. I am about to start
After, reading and understanding Dan Benjamin's post about installing Ruby, Rails, etc. on OSX
My understanding of Hibernate is that as objects are loaded from the DB they
My understanding is that wxWidgets is for a number of programming languages (C++, Python,
My understanding is that C/C++ produces native code to run on a particular machine
My understanding is that in unix, when memory is freed, the memory doesn't get
I have an iOS app that displays content from a sqlite db in a
I am thinking about taking the 70-536 exam, and there is all this stuff
My understanding of the Git pack file format is something like: Where the table

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.