Title: Css button color change
Last modified: August 30, 2016

---

# Css button color change

 *  Resolved [NetMonkey](https://wordpress.org/support/users/headmonkey/)
 * (@headmonkey)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/)
 * Hey all,
 * I’m trying to change some WordPress core css and can’t seem to get it right. 
   It’s for the login button. The first css below is the standard blue button and
   the second is the color change I’ve inserted into the theme’s custom css settings,
   but it’s not working. Not even when I insert the !important statement on the 
   color lines.
 *     ```
       .wp-core-ui .button-primary {
           background: #00A0D2 none repeat scroll 0% 0%;
           border-color: #0073AA;
           box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.5) inset, 0px 1px 0px rgba(0, 0, 0, 0.15);
           color: #FFF;
           text-decoration: none;
       }
   
       .wp-core-ui .button-primary {
           background: #32DDCA none repeat scroll 0% 0%;
           border-color: #15C0AD;
           box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.5) inset, 0px 1px 0px rgba(0, 0, 0, 0.15);
           color: #FFF;
           text-decoration: none;
       }
       ```
   
 * Can someone please tell me what I’m doing wrong?
 * Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795532)
 * Are you trying to change the style of something in the Dashboard?
 *  Thread Starter [NetMonkey](https://wordpress.org/support/users/headmonkey/)
 * (@headmonkey)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795534)
 * I’m just trying to change some of the css color styling on the login form that
   every user sees. The standard WordPress login button is blue and I want to change
   the color.
 * Using Firefox inspector, the first css code above is what’s there now and the
   second css is my color change that’s not being accepted.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795537)
 * You need to do enqueue your own stylesheet for that. Do you have a Child Theme
   set up?
 *  [megafreechips](https://wordpress.org/support/users/megafreechips/)
 * (@megafreechips)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795539)
 * First of all,
    in terms of CSS best practices, when over-writing default styles–
   it’s better to add a custom class, rather than change or over-write the original
   class. This way you can always easily revert your changes and have a more modular
   control on the styles.
 * If you keep it like that, then the last style should be used according to CSS
   order rules, as they both have the same specificity.
    !important is not recommended
   to use, as it cancels specificity & order, which makes it hard to maintain in
   the long-run.
 * Back to our issue … 🙂
    Can you provide the page but apply the ‘background’ style
   change with a custom class ? so I can check via DevTools why your change is being
   over-written. I assume it’s just an issue of specificity…
 *  Thread Starter [NetMonkey](https://wordpress.org/support/users/headmonkey/)
 * (@headmonkey)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795545)
 * I do have a child theme setup.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795560)
 * Create a functions.php file in your Child Theme if you haven’t already and add
   this code to it:
 *     ```
       function my_login_logo() {
           wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/style-login.css' );
       }
       add_action( 'login_enqueue_scripts', 'my_login_logo' );
       ```
   
 * Then put a ‘style-login.css’ file inside your Child Theme folder and put your
   CSS modifications in there.
 * _[https://codex.wordpress.org/Customizing\_the\_Login\_Form#Styling\_Your\_Login](https://codex.wordpress.org/Customizing_the_Login_Form#Styling_Your_Login)_
 *  Thread Starter [NetMonkey](https://wordpress.org/support/users/headmonkey/)
 * (@headmonkey)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795564)
 * I’ve just tried what you suggested, but there must be an incorrect path for style-
   login.css. Because I have the new style-login.css in my child folder, the changes
   to my functions file, but the login page now shows this line at the top, with
   no changes:
 * `wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/style-login.
   css' );`
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795566)
 * Oops I forgot some code, if you are creating a new Child Theme functions.php 
   file try adding this instead:
 *     ```
       <?php
       function my_login_logo() {
           wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/style-login.css' );
       }
   
       add_action( 'login_enqueue_scripts', 'my_login_logo' );
       ?>
       ```
   
 *  Thread Starter [NetMonkey](https://wordpress.org/support/users/headmonkey/)
 * (@headmonkey)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795568)
 * Okay, that worked, (sort of). It made the color changes I wanted, but threw two
   header errors at the top of the page also.
 * Maybe the color change is not so important after all…
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795572)
 * What are the errors, headers already sent? Try removing this bit in the code:
 *     ```
       ?>
       ```
   
 *  Thread Starter [NetMonkey](https://wordpress.org/support/users/headmonkey/)
 * (@headmonkey)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795583)
 * That did it. WordPress doesn’t like two php closing codes…
 * Thanks for your help with this one. Consider it closed.
 * Barry

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Css button color change’ is closed to new replies.

## Tags

 * [wordpress.css](https://wordpress.org/support/topic-tag/wordpress-css/)

 * 11 replies
 * 3 participants
 * Last reply from: [NetMonkey](https://wordpress.org/support/users/headmonkey/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/css-button-color-change/#post-6795583)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
