• I have a WordPress theme that I created, but for some reason in my template header, some of the styles I have declared are being overridden somehow. When I inspect in Chrome some of those elements are not listed as if they are not in my style.css, but they are.

    I can’t figure this out for anything. For example, there are some elements that should be set to display:none in desktop mode, but they are still showing. My footer styles in style.css are not getting applied. I have tried using Chrome to see what is going on, and I’ve tried setting some declarations to !important, but that doesn’t even work.

    Any help would be greatly appreciated!

    section.page-area { position:relative; top:0px; margin:0px; margin-left:auto; margin-right:auto; width:60%!important; margin-bottom:50px; }

    .mobile-nav-container, nav-menu, button.open-menu, button.open-menu-small, .home-btn-mobile, #main-logo-mobile, #mobile-logo, .cover-current-mobile { display:none!important; }

    This is just a tiny snippet of CSS that is not getting applied.

    My style.css file is quite large now, so I’m not sure if that is the problem, where it is taking a long time to load the rest of the style? There are about 8k lines of CSS that I have combined to cut down HTTP requests, as opposed to individual style sheets.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Did you use a child theme to create your new theme?

    If so, the parent theme may be overwriting some styles, where you don’t specify something completely, the parent theme style will fill in the gaps.

    If this isn’t the case, have you checked that your css file is saving to the server ok?
    Do you have a link we can check to help you?

    Thread Starter mefowler

    (@mefowler)

    I created my own theme. I just took out some entry content from my WordPress template pages, I thought that was going to help, but so far it hasn’t. Mainly, I’m having an issue with the styling of the text/copy across the WordPress portion of the site (I’m in the process of converting to WordPress from static site), and large images coming from mobile view that should be set to display none. The main h1.page-headline is getting applied, I’m not sure why anything else isn’t. At this point I think I took out all of my WordPress styles.

    Do you have a link we can check to help you?

    do u have more than two style sheets?

    if so..than put your one style sheet beneath the other..and the lower style sheet will replace/override the style of the other..if they are define in both stylesheets.
    so checkout the order of your style sheet’s.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Some styles in my style.css file are not getting applied, or getting overridden’ is closed to new replies.