• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Hiding / Showing Content with breakpoint

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Hiding / Showing Content with breakpoint

This topic is: not resolved

Tagged: breakpoint, css, show hide

  • This topic has 2 replies, 2 voices, and was last updated 9 years ago by SavvyJackie.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • October 1, 2014 at 10:44 am #126443
    ScottFromPA
    Member

    What's up guys?

    I a bit fuzzy on break points and I need help. I have created a "Header Right" widget containing two divs I'd like one to hide and one to show based upon what device hits the site.

    I'm using the following..

    //medium+ screen sizes
    @media (min-width:992px) {
        .desktop-only {
            display:block !important;
        }
    }
     
    //small screen sizes
    @media (max-width: 991px) {
        .mobile-only {
            display:block !important;
        }
     
        .desktop-only {
            display:none !important;
        }
    }

    One div looks like this<div class="desktop-only"> Seen for all devises except cells</div>

    the other

    One div looks like this<div class="mobile-only"> Seen only for cell phone</div>

    When I post it to my custom style sheet the entire site falls apart.

    Any guidance as to why it fails? I'm stumped.

    Thanks

    October 3, 2014 at 9:40 am #126682
    SavvyJackie
    Member

    Have you tried using the "only screen" like this:


    @media
    only screen and (min-width:992px)


    @media
    only screen and (max-width:991px)


    Web Designer and Developer at Savvy Jackie Designs | Lucky with plants | @SavvyJackie

    Got your question answered here? Please pay it forward by helping someone else. I’m sure there is at least one question you can answer. 🙂

    October 3, 2014 at 9:45 am #126684
    SavvyJackie
    Member

    Also - what about adding

    @media
    only screen and (min-width:992px)
    .mobile-only {
    display:none !important;
    }

    to make sure the mobile is turned off on desktop?


    Web Designer and Developer at Savvy Jackie Designs | Lucky with plants | @SavvyJackie

    Got your question answered here? Please pay it forward by helping someone else. I’m sure there is at least one question you can answer. 🙂

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble