css - hide div tag on mobile view only? -
i'm creating fluid layout site. i'm trying hide contents of <div>
or whole <div>
in mobile view, not tablet , desktop view.
here's i've got far...
#title_message { clear: both; float: left; margin: 10px auto 5px 20px; width: 28%; display: none; }
i have display set 'none' mobile layout , set block on tablet/desktop layouts... there easier way that, or it?
you need 2 things. first @media screen
activate specific code @ screen size, used responsive design. second use of visibility: hidden
attribute. once browser/screen reaches 600pixels #title_message
become hidden.
@media screen , (max-width: 600px) { #title_message { visibility: hidden; clear: both; float: left; margin: 10px auto 5px 20px; width: 28%; display: none; } }
edit: if using css mobile add visibility: hidden;
#title_message
. hope helps you!
Comments
Post a Comment