<![CDATA[ Hiding sections from mobile viewing - My Forums]]> https://forums.modx.com/thread/?thread=96735 <![CDATA[Hiding sections from mobile viewing]]> https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing?page=2#dis-post-523500 Can anyone tell me how you actually hide 2 sections on the homepage from being viewed on a mobile device?]]> cwestcott Mar 27, 2015, 11:26 AM https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing?page=2#dis-post-523500 <![CDATA[Re: Hiding sections from mobile viewing]]> https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing?page=2#dis-post-523668 cwestcott Mar 30, 2015, 03:20 PM https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing?page=2#dis-post-523668 <![CDATA[Re: Hiding sections from mobile viewing]]> https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing?page=2#dis-post-523667 nuan88 Mar 30, 2015, 03:08 PM https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing?page=2#dis-post-523667 <![CDATA[Re: Hiding sections from mobile viewing]]> https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing?page=2#dis-post-523642
If you take a look at "assets/design/css/skeleton.css" you will find the following:
/*  #Mobile (Portrait)
================================================== */

    /* Note: Design for a width of 320px */

    @media only screen and (max-width: 767px) {
        .container { width: 300px; }

AND
/* #Mobile (Landscape)
================================================== */

    /* Note: Design for a width of 480px */

    @media only screen and (min-width: 480px) and (max-width: 767px) {
        .container { width: 420px; }


If you want to keep your CSS in line with Skeleton you can preset it to the following:
@media only screen and (max-width: 767px) {
	.container .featured {display:none;}
	}

This says: any device viewport with a size below 767px should not display the featured section, everything above this size should show the section.

The problem here (which could possibly arise) is: you are hiding a section that is nested. You could end up with an empty coloured block (in your design, grey), which is possibly not what you want.

You could create a universal class that can be added to any element that you don't want to be shown in mobile devices.

Example CSS:
@media only screen and (max-width: 767px) {
        .hidemobile {display:none;}
	}

Example HTML:
<section class="container hidemobile">
  <article class="sixteen columns zeroed">
    <section class="featured">
      <div class="eight columns alpha">
        <div class="padding">
          POST CONTENT
        </div>
      </div>
      <div class="eight columns omega">
        <div class="padding">
          POST CONTENT
        </div>
      </div>
      <div class="clear"></div>
    </section>
  </article>
</section>

Note:
<section class="container">

Changes To:
<section class="container hidemobile">
]]>
iusemodx Mar 30, 2015, 08:29 AM https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing?page=2#dis-post-523642
<![CDATA[Re: Hiding sections from mobile viewing]]> https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing?page=2#dis-post-523637 comp_nerd26 Mar 30, 2015, 05:59 AM https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing?page=2#dis-post-523637 <![CDATA[Re: Hiding sections from mobile viewing]]> https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing#dis-post-523633 sottwell Mar 30, 2015, 05:15 AM https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing#dis-post-523633 <![CDATA[Re: Hiding sections from mobile viewing]]> https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing#dis-post-523628 ]]> nuan88 Mar 30, 2015, 03:51 AM https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing#dis-post-523628 <![CDATA[Re: Hiding sections from mobile viewing]]> https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing#dis-post-523625
that needs to be display:none smiley]]>
fourroses666 Mar 30, 2015, 02:57 AM https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing#dis-post-523625
<![CDATA[Re: Hiding sections from mobile viewing]]> https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing#dis-post-523525

Usually the css goes something like this:

/*--------
Regular styling
--------*/

.header {}
.nav {}
.featured {}
.footer {}

/*RESPONSIVE Styling*/
@media screen and (min-width: 1780px) {
.featured {width:100%;}
}
@media (max-width: 1440px) {
.featured {width:60%;}
}
@media (max-width: 480px) {
.featured {display:hidden;}
}

Just as an example, and this organization is just to make it easier to find stuff in the css. Here I have tried to sort of walk down the size of the featured div.

One last issue is loading unnecessary data, with a phone you want to provide a lighter page. Here its still loading but just not shown. To avoid loading that...I am sorry I don't know how to do it, but it can be done without a doubt.]]>
nuan88 Mar 27, 2015, 10:27 PM https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing#dis-post-523525
<![CDATA[Re: Hiding sections from mobile viewing]]> https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing#dis-post-523522 find
.featured {
  background: #F2F2F2;
}
Change to:
.featured {
  background: #F2F2F2;
}
@media screen and (max-width: 300px) { //300 is an example of mobile size
.featured {
 display: none;
}
}
]]>
donshakespeare Mar 27, 2015, 09:52 PM https://forums.modx.com/thread/96735/hiding-sections-from-mobile-viewing#dis-post-523522