简体   繁体   中英

How to hide an included php page with css based on media size

I am trying to update my site to responsive. I have several includes in php on a page. Using media queries sizes I want to hide one of them when it is phone size. Is it possible to hide this with css?

<?php include('slideshow.html'); ?> 

Thanks for any suggestions!

You can place a div before php file include , and hide it on mobile resolution . Like following example .

<div class="slide_show">
<?php include('slideshow.html'); ?> 
</div>

css

<style type="text/css">
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
.slide_show {
   display:none;
}
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM