CMS Development

christinacschne
投稿者

Media Query for Mobile

解決

 

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?

 

https://info.comporium.com/-temporary-slug-8ce16fa4-38a9-441f-974d-e496f46d70a3?hs_preview=yvIVMKRn-...

0 いいね!
2件の承認済みベストアンサー
AntonB
解決策
参加者

Media Query for Mobile

解決

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

 

元の投稿で解決策を見る

valerajoey
解決策
参加者 | Platinum Partner
参加者 | Platinum Partner

Media Query for Mobile

解決

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.

元の投稿で解決策を見る

4件の返信
valerajoey
解決策
参加者 | Platinum Partner
参加者 | Platinum Partner

Media Query for Mobile

解決

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.

christinacschne
投稿者

Media Query for Mobile

解決

Thanks! I appreciate your feedback and sharing the SMART content fix!

0 いいね!
AntonB
解決策
参加者

Media Query for Mobile

解決

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

 

christinacschne
投稿者

Media Query for Mobile

解決

Thanks! 

0 いいね!