CMS Development

christinacschne
Colaborador(a)

Media Query for Mobile

resolver

 

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 Avaliação positiva
2 Solução aceitas
AntonB
Solução
Participante

Media Query for Mobile

resolver

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

 

Exibir solução no post original

valerajoey
Solução
Participante | Parceiro Platinum
Participante | Parceiro Platinum

Media Query for Mobile

resolver

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.

Exibir solução no post original

4 Respostas 4
valerajoey
Solução
Participante | Parceiro Platinum
Participante | Parceiro Platinum

Media Query for Mobile

resolver

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
Colaborador(a)

Media Query for Mobile

resolver

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

0 Avaliação positiva
AntonB
Solução
Participante

Media Query for Mobile

resolver

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
Colaborador(a)

Media Query for Mobile

resolver

Thanks! 

0 Avaliação positiva