Apply CSS to mobile only

Hi, I want to apply this command: #Top_bar:not(.is-sticky) .menu_wrapper { margin-top: 50px !important; } to custom CSS but only for mobile, I would like the menu wrapper for desktops to remain the same and for this to only apply for mobile phones, how would I do this? Thank you

Comments

  • Hi,
    You have to insert this CSS into media queries

    We usually use this property.

    @media (max-width:767px){
    #idofclass{
    CSS code
    }
    }
    Thanks
  • Thank you, I have inserted this: @media (max-width:767px){
    #idofclass{
    #Top_bar:not(.is-sticky) .menu_wrapper { margin-top: 80px !important; }
    }
    }
    But it still does not change it. maybe because above I have this code: #Top_bar:not(.is-sticky) .menu_wrapper { margin-top: 12px !important; } for desktop. How do I resolve this?
    Thank you
  • Pablo have sent you an example of what the css should look like. #idofclass is just an example.
    Please sent us a link to your website and explain what exactly you would like to do.
    Make screenshots if possible.
    thanks
  • Hi, sorry I misunderstood! First, I would like the dark blue header colour to cover the logo and menu, because as shown on this screenshot this only covers the top bit of the screen. This is because I used CSS to make the header space smaller for desktop but I need it to stay the original size for mobile. I would also like the logo to be in line with the menu icon because it is underneath it currently. This is the screenshot for that: https://imgur.com/TrvVxe8 Also, as shown on the other screenshot (https://imgur.com/RFP8hen) I would like to remove the cart icon and move the menu down (the home button etc), which I assume will happen when the header becomes the right size. Thank you very much
  • You would have to remove your custom css for the header and go to theme options>global>logo. There change the height and the vertical padding of the logo. It will lower the height of the header.

    Then go to theme options>responsive>header and switch on the minimalist header option for the mobile.
  • Thank you it is fixed now
Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.