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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:42:11+00:00 2026-06-17T09:42:11+00:00

I have added a button styling to a div. The background-color does not apply

  • 0

I have added a button styling to a div. The background-color does not apply to the normal state. However, as soon as I click down on the button and turn it into an active state, the background-color applies correctly. I cannot figure out why the background-color only appears in one stage and not the other. I have resorted to using !important to make it work. Below is the CSS:

.statusbutton {
    -moz-box-shadow:inset 0 1px 0 0 #ffffff;
    -webkit-box-shadow:inset 0 1px 0 0 #ffffff;
    box-shadow:inset 0 1px 0 0 #ffffff;
    height:43px;
    width:40px;
    border:1px solid #ccc;
    -moz-border-radius:2px;
    -webkit-border-radius:2px;
    border-radius:2px;
    display:inline-block;
    background-color:#fbfbfb !important;
}


.statusbutton:active {
    position:relative;
    background-color:#fbfbfb;
    top:1px;
}

EDIT: I realized the issue came from a later part of my stylesheet:

.red {
background:url(status-red.png) no-repeat center center;
}

I applied .red to the button afterwards, which caused the background image to override the background-color. The code below ended up fixing the issue:

.red {
background:url(status-red.png) no-repeat center center;
background-color:#fbfbfb;
}
  • 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-06-17T09:42:12+00:00Added an answer on June 17, 2026 at 9:42 am

    Using !important is usually a bad idea. Is this your entire css file or is there more? There may be another css style with higher priority that is overriding your attempts to set the background color here. I would suggest setting up a jsfiddle if you’re still having trouble

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

Sidebar

Related Questions

I have a problem with asp:button styling. I added following style: .myAspButton { background-image:
I have a nav button added by myself. when click it I use: $(#+gridId).setColProp('myColumn',
In my VIew, i have added a button and when i click on it,
I have added a button inside a loginview, but then this code is not
I have a div tag which has some background color, that adds good look
I have added a Button in the View { xtype:'button', id:'when_button_click', text:'Button Click', ui:'alert'
I have coded my calculator in simple mode, I have added a button for
I have working with a project and i added a share button to product
I have a button that when pressed, a tableview section will be added and
I have created a asp.net website and i added tooltip to a button by

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.