CMS Development

MNault
Contributor | Elite Partner
Contributor | Elite Partner

hide/show module on mobile

SOLVE

Hello! I have a landing page that displays an embedded Adobe Online Publication. I have created a pub version for both wide screen and mobile screen viewing and have embedded them on the page. I would like to have the "widescreen" version show when the media is 601px or more. I would like to have the "mobilescreen" version show when the media is 600px or less. https://info.greystonecc.com/-temporary-slug-7b575b82-ecfa-4d5b-82b5-dd55f9269a10?hs_preview=HVagNpE...

0 Upvotes
1 Accepted solution
alyssamwilie
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

hide/show module on mobile

SOLVE

@MNault Try either putting them each in a group wrapper with their classes on it or add !important to the styles cause looks like there's a display: block on the widget-span class that's overwritting the media queries.

 

 

<style>
  @media (min-width: 601px) {
    .mobilescreen {
      display: none !important;
    }
  }

  @media (max-width: 600px) {
    .widescreen {
      display: none !important;
    }
  }
</style>

 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

View solution in original post

3 Replies 3
alyssamwilie
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

hide/show module on mobile

SOLVE

@MNault Try either putting them each in a group wrapper with their classes on it or add !important to the styles cause looks like there's a display: block on the widget-span class that's overwritting the media queries.

 

 

<style>
  @media (min-width: 601px) {
    .mobilescreen {
      display: none !important;
    }
  }

  @media (max-width: 600px) {
    .widescreen {
      display: none !important;
    }
  }
</style>

 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
alyssamwilie
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

hide/show module on mobile

SOLVE

@MNault  You can add the following media queries either to the template's stylesheet, the template <head>, or in the additional head markup of the page's settings.

<style>
  @media (min-width: 601px) {
    .mobilescreen {
      display: none;
    }
  }

  @media (max-width: 600px) {
    .widescreen {
      display: none;
    }
  }
</style>

 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
MNault
Contributor | Elite Partner
Contributor | Elite Partner

hide/show module on mobile

SOLVE

I dropped it into the page settings HEAD and it did not work when I checked it on my phone. So I dropped it into the template HEAD markup and still nothing. I must be doing something wrong. Just to confirm, I have given the Rich Text modules the class of "widescreen" and "mobilescreen" like image. Is this correct? 

MNault_0-1618931729080.png

 

0 Upvotes