Title: Since version 4.5 login_enqueue_scripts Doesn&#039;t ovewrite the default styles
Last modified: August 31, 2016

---

# Since version 4.5 login_enqueue_scripts Doesn't ovewrite the default styles

 *  Resolved [Mizunga](https://wordpress.org/support/users/mizunga/)
 * (@mizunga)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/since-version-45-login_enqueue_scripts-doesnt-ovewrite-the-default-styles/)
 * Hello,
 * After updating to WP 4.5 my styles to customize the login page do not overwrite
   the default WP styles. Here is the [link ](http://prep.kevinmamaqi.com/wp-login.php)
   Here’s my code:
 *     ```
       function my_login_logo() { ?>
           <style type="text/css">
               .login h1 a {
                   background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/assets/images/logo.png);
                   padding-bottom: 30px;
                   width: 297px;
                   height: 64px;
                   background-size: 297px;
               }
               .login form {
                 -webkit-box-shadow: 0 1px 6px rgba(0,0,0,.4);
                 box-shadow: 0 1px 6px rgba(0,0,0,.4);
               }
   
               .login label {
                 color: #333;
               }
   
               .login #nav a {
                 color: #007CAD;
               }
   
               body, html {
                 background: #fff;
               }
           </style>
       <?php }
       add_action( 'login_enqueue_scripts', 'my_login_logo' );
       ```
   

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

 *  [homebysix](https://wordpress.org/support/users/homebysix/)
 * (@homebysix)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/since-version-45-login_enqueue_scripts-doesnt-ovewrite-the-default-styles/#post-7280805)
 * Thanks for reporting this. I’m experiencing the same issue on multiple WordPress
   sites since updating to 4.5 as well.
 * I was able to fix the issue by adding `!important`, but that doesn’t seem like
   an excellent long term solution.
 *     ```
       function my_login_logo()
       {
           ?><style type="text/css">
               .login h1 a {
                   background-image: url("<?php echo get_stylesheet_directory_uri(); ?>/images/site-login-logo.png") !important;
                   background-repeat: no-repeat !important;
                   background-size: 180px 120px !important;
                   height: 120px !important;
                   padding-bottom: 60px !important;
                   width: 180px !important;
               }
           </style><?php
       }
       add_action('login_enqueue_scripts', 'my_login_logo');
       ```
   
 *  [wprwb](https://wordpress.org/support/users/wprwb/)
 * (@wprwb)
 * [10 years ago](https://wordpress.org/support/topic/since-version-45-login_enqueue_scripts-doesnt-ovewrite-the-default-styles/#post-7280832)
 * I have solved this issue by just changing the CSS selector from
 * `.login h1 a`
 * to
 * `#login h1 a`
 *  Thread Starter [Mizunga](https://wordpress.org/support/users/mizunga/)
 * (@mizunga)
 * [10 years ago](https://wordpress.org/support/topic/since-version-45-login_enqueue_scripts-doesnt-ovewrite-the-default-styles/#post-7280833)
 * The problem is the login_enqueue_scripts hook itself. Better use login_head()
   and it will be solved.

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

The topic ‘Since version 4.5 login_enqueue_scripts Doesn't ovewrite the default 
styles’ is closed to new replies.

## Tags

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

 * 3 replies
 * 3 participants
 * Last reply from: [Mizunga](https://wordpress.org/support/users/mizunga/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/since-version-45-login_enqueue_scripts-doesnt-ovewrite-the-default-styles/#post-7280833)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
