WordPress.org

Ready to get started?Download WordPress

Forums

Responsive
[resolved] How to use different CSS for header and body (8 posts)

  1. jalbc
    Member
    Posted 1 year ago #

    I created a customized menu the header of my site - for it to work, I created a new stipped-down stylesheet and linked to it. (With the original stylesheet, the original styles were interfering with the layout and function of my menu. I couldn't track them all down to change them). Now my menu looks like I want it to look, but the rest of the site isn't formatted. Is there any way to use my new stylesheet (menustyle.css) just for the header, and then use the responsive child stylesheet starting with the body? I don't mind if they both are applied to the body section, I just don't want all of the imported styles applied to the menu.

    I'm new to wordpress, and this is the only way I can figure out to use the theme stylesheet while still having the menu appear correctly. Help?

  2. Emil Uzelac
    Theme Review Admin
    Posted 1 year ago #

    Hi,

    Is there a live site that I see please?

    Thanks,
    Emil

  3. jalbc
    Member
    Posted 1 year ago #

    Here is the link to site with menu and a few sample pages only:

  4. Emil Uzelac
    Theme Review Admin
    Posted 1 year ago #

    Simple fix. The Child Theme you're using is not importing any styles from the Parent Theme, therefore the formattings are gone.

    In your Child Theme there should be a style.css and in that style.css this:

    /*
    Theme Name: Responsive Child Theme
    Theme URI: http://themeid.com/responsive-theme
    Description: Responsive Child Theme
    Author: Emil Uzelac
    Author URI: http://themeid.com
    Template: responsive
    Version: 1.0
    */
    
    /* Import Responsive Styles */
    @import url('../responsive/style.css');

    Thanks,
    Emil

  5. jalbc
    Member
    Posted 1 year ago #

    Thanks for your quick response Emil! Let me rephrase part of the question. I intentionally took the 'import parent style.css' part out of the Child Theme - because I did NOT want all of those formatting elements included in the header. I was not able to create the menu with the formatting from the imported style sheet mixed in. I'm a newbie at wordpress, so I stripped down everything for the header. However, I would like to be able to add in the imported stylesheet for the body portion of the website - but not the header. Is this possible? Can I have only one stylesheet apply to the header and then bring in a second stylesheet for the body portion? Or is there another way to achieve this? Thanks so much!

  6. Emil Uzelac
    Theme Review Admin
    Posted 1 year ago #

    No problem. Here's the deal. We can strip down many things, however some of them are very much needed for the Theme to look and work properly. For example, grids, container, wrapper etc. So if they're not included while their IDs/Classes are still in the Theme you won't be able to get what you are after.

    Including an additional stylesheet is great, however I would still keep defaults in place and you can override them easily. Theme is very simple and nothing overly complicated either.

    Child Themes cannot work without Parent Theme :)

    Thanks,
    Emil

  7. jalbc
    Member
    Posted 1 year ago #

    Thank you - I really do appreciate it. I know how many messages and questions you must receive. I understand what you're saying. I was just hoping to use the menu as-is since it took me a couple of weeks to get it to work. I did import the stylesheet back in. The topmenu is affected and the submenu gone now, but I will keep at it. I'm learning all of this! Thanks :)

  8. Emil Uzelac
    Theme Review Admin
    Posted 1 year ago #

    Don't worry about the questions, that is why I'm here :)

    Please visit our dedicated forums as well.

    Thanks,
    Emil

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.