Dear enfold support team,
i have one 3 columns layout on my home page. I want to display it into a 2 columns layout on mobile version. Each column shouldn’t be larger than 354px.
Could you please tell me how can I do this?
Hey vnfan,
Please try the following in Quick CSS under Enfold–>General Styling:
@media only screen and (max-width: 767px) {
.home .av_one_third {
width: 50% !important;
}
}
Regards,
Rikard
Hi Rikard,
thanks for working on the weekend. I have used max-width: 354px, instead of 50%. The columns look better now.
One more question for this: how can I set each column stand in the middle (instead of on the left) of the smart phone (witdh 667px for example)?
Hi,
Please try something like this to center the elements:
@media only screen and (max-width: 667px) {
.home .av_one_third {
display:table !important;
margin:0 auto !important;
}
}
Best regards,
Rikard
Hi Rikard,
now the columns stay in the middle but there now space between them anymore (mobile version)
Hi,
Adjust the code to look like this:
@media only screen and (max-width: 737px) {
.home .av_one_third {
display: table !important;
margin: 0 auto 20px auto!important;
}
}
The “737” width value is not a standard screen size. You should “768” or “667” for iPhone screens.
Best regards,
Ismael
Thanks Isamel