Hello.
I’m trying to setup a media query to hide the small mobile friendly image (below the shop now) until the page is on a mobile device. Any thoughts?
Hello.
I’m trying to setup a media query to hide the small mobile friendly image (below the shop now) until the page is on a mobile device. Any thoughts?
Hi @christinacschne,
it’s pretty simple. If your object has a Class or an ID you can hide it with following solution:
@media screen and (max-width:XXX px){
.your-class{
display:none;}
}
@media screen and (max-width:XXX+1 px){
.your-class{
display:block;}
}
For example:
if you want to hide your element on smartphones(most likely 480px width;iPhones have different/other resolutions) your code should look like this
@media screen and (max-width:480px){
.your-class{
display:none;}
}
@media screen and (max-width:481 px){
.your-class{
display:block;}
}
You can find a list of media queries here
regards
Anton
|
| Did my post help answer your query? Help the Community by marking it as a solution |
| — | — |
Thanks!
hey there I’ve just visited your site, you have a quite a unique site here, a site which consists mostly of an image, here’s a tip I can give you, to minimize your work doing this thing, If you’re using a rich text field you can just use SMART content to change the your content based on 3 resolution (desktop , tablet , mobile) I just don’t know what the specific resolution tho. but you can still use media query CSS rules to override something.
happy coding.
Thanks! I appreciate your feedback and sharing the SMART content fix!