Home › Forums › WoodMart support forum › CSS3 Media Queries
CSS3 Media Queries
- This topic has 7 replies, 3 voices, and was last updated 7 years, 2 months ago by Artem Temos.
-
AuthorPosts
-
September 27, 2017 at 5:29 pm #20366
dozeParticipantHello,
I’ve set this CSS code for tabs in single product page:
.product-tabs-wrapper
{ width: auto;
margin-right: 400px;
margin-left: auto;
border: solid;
}It does indeed what I wanted (to allign tab content to product image and product info above, in order to leave blank space to the right) but the problem is: when the screen gets smaller in responsive mode the right margin pushes the content leftward.
I looked into it a bit and found out about @media screen and min-width: query and wrote this:
@media screen and (min-width: 800px) {
#product-tabs-wrapper
{ width: auto;
margin-right: 400px;
margin-left: auto;
border: solid;
}}but it doesn’t work. Is there a way to achieve that?
Also, is there a CSS code to make single product page sidebar invisible on mobile?
Many thanks,
Regards
September 27, 2017 at 6:27 pm #20367
Artem TemosKeymasterHi,
Actually, you don’t need to write media queries since we have already done it for you. You can just apply different CSS code for different devices adding it to our Custom CSS fields. In Theme Settings -> Custom CSS you can find a few areas for all devices.
Regards
September 29, 2017 at 3:31 pm #20452
dozeParticipantRight. Well done, I didn’t notice.
Anyway, I can’t come up with the right code: I’ve set custom CSS
.sidebar-right.area-sidebar-product-single {
visibility: hidden;
}for mobile, and it does work but not the way I want. It keeps showing me blank space where the sidebar was supposed to be, without the content (the widget I use in desktop only). I would like the sidebar to disappear completely on mobile, is there a way to do it?
Plus, the code
.product-tabs-wrapper
{ width: auto;
margin-right: 400px;
margin-left: auto;doesn’t work the way I thought: as product page layout adapts to different screen sizes, so does the right margin. Right now it works perfectly with the monitor I use (14” wide). Is it possible to align tabs right margin to product info right margin, making it fixed? Settings I use are: wide layout, non full width single product page, medium sidebar to the right.
Thank you!
September 29, 2017 at 8:18 pm #20455
Artem TemosKeymasterHi,
Use this for the sidebar instead
.sidebar-right.area-sidebar-product-single { display: none; }
Could you please prepare a screenshot of what do you want to do with the product page?
Regards
October 3, 2017 at 2:30 pm #20653
dozeParticipantHi,
sorry for the late reply. Thanks for the code!
Find attached two snapshots, in the first one right margin of product tabs is aligned, in the second one I have a smaller windows resolution and right margin of product tabs is pushed to the left, I would like it to stay aligned, regardless of windows resolution (with bigger resolutions the problem is the other way round). I don’t think there is a fix, but in case you come up with one… 🙂
Attachments:
You must be logged in to view attached files.October 3, 2017 at 5:42 pm #20674
Bogdan DonovanKeymasterHello,
Try to add the following code snippet to the Custom CSS area in Theme Settings to fix this issue.
body .product-tabs-wrapper { margin-right:auto; max-width: calc(68.5% + 17px); margin-left: 2.5%; } body .product-tabs-wrapper .container { width: 100%; max-width: 100%; } @media (max-width: 1400px) { body .product-tabs-wrapper { max-width: calc(72% + 17px); } } @media (max-width: 1024px) { body .product-tabs-wrapper { max-width: calc(69.5% + 17px); } } @media (max-width: 767px) { body .product-tabs-wrapper { max-width: 100%; margin-left: 0; } }
Regards
October 3, 2017 at 7:37 pm #20675
dozeParticipantAwesome, thanks a lot!
October 3, 2017 at 8:03 pm #20680
Artem TemosKeymasterYou are welcome!
-
AuthorPosts
The topic ‘CSS3 Media Queries’ is closed to new replies.
- You must be logged in to create new topics. Login / Register