Parent and child CSS both classes loading as per CSS rules, but parent is functioning and child failing.

.navigation-top {
    background: #fff;
    border-bottom: 1px solid #eee;
    border-top: 1px solid #eee;
    font-size: 16px;
    font-size: 1rem;
    position: relative;

.navigation-top {
    background-color: #eeeeee;
    border-bottom: 2px solid #e60909;

My functions.php is shown below:

add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX);
function enqueue_child_theme_styles() {
  wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
  • Remove that closing ?> PHP tag from your functions.php. – leymannx Mar 26 at 20:39

You should type with


Tag with css like these it will work

.navigation-top { background-color: #eeeeee !important; border-bottom: 2px solid #e60909 !important; }
  • Thanks a lot . It worked... You saved my time .. :) – Nityanand Shet Mar 26 at 20:52
  • my pleasures please click on "accept Answer" if it helpful for you :-) – Aadii Mughal Mar 26 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.