I am new in wordpress developing, I try to edit my first blog, editing the menu was not painful, but the footer does not respect the css codes despite the stylesheet is the same.

Here is the code where I enqueue the css stylesheet file:

function load_stylesheets() {
/* loading my own stylesheet */
wp_register_style('style', get_template_directory_uri() . '/css/mainstyle.css', array(), false, 'all');
add_action('wp_enqueue_scripts', 'load_stylesheets');

this is where I display my footer:

<footer class="footer">
<div class="container">
    <div class="row">
        <div class="footermenu col-md-4 col-xs-12 text-right">
            <?php if (has_nav_menu('footer-menu')) : ?>
                                'theme_location' => 'footer-menu',
                                'menu_class' => 'footermenu'
            <?php endif; ?>
<?php wp_footer(); ?>

this is how I try to make some styling changes:

footer .footer {  
background-color: #3a9dca;
.footermenu ul {
list-style-type: none;

1 Answer 1


It's just css misunderstanding. if you want to select elementname.classname it means you are selecting elements by type of certain class like in fixed example below, but you've put a space between footer and .footer and this way rule expects markup like this

<footer> <div class="footer"></div> </footer>

This should work.

footer.footer {  
    background-color: #3a9dca;
footer .footermenu ul { /* i've added footer prefix here just for explicity - it was right before as well but it wasn't more specific as it is now */
    list-style-type: none;
  • thank you, it worked
    – Hind Dev
    Mar 16, 2020 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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