Tagged: x
-
AuthorPosts
-
May 2, 2016 at 1:31 am #908626
arefsParticipantI’ve set the padding for a section to 100 left and and right.
However, on a mobile device this looks bad.
How can I set this padding so it only displays for certain screen width?
I want to display it for only XL and LG screen widths.
Thanks.
May 2, 2016 at 2:45 am #908691
Rue NelModeratorHello There,
Thanks for writing in!
The best recommend I could is this. Please insert a custom
my-sectionclass in your section. We will then use a custom css so that the padding will only be visible in large and extra large screens. You can make use of this code:@media(min-width: 980px){ .my-section{ padding-left: 100px; padding-right: 100px; } }Hope this helps. Kindly let us know.
May 2, 2016 at 8:57 pm #910052
arefsParticipantThis reply has been marked as private.May 2, 2016 at 9:20 pm #910068
John EzraMemberHi there,
Thanks for updating the thread! Would you mind providing screenshots of what you mean? We are unable to see or replicate your issue on our end. Would you have happened to have solved your issue already? The CSS seems to be working properly on both links on our end. Please update us otherwise – thanks!
May 3, 2016 at 8:19 pm #911698
arefsParticipantI can do better than screenshots. Please watch this 90 second video which should make it very clear – https://dl.dropboxusercontent.com/u/17713251/2016-05-04_1018.swf
May 4, 2016 at 3:12 am #912083
LelyModeratorHi There,
Thanks you for the video.
If you want to use those class for different pages, please just add the CSS on Appearance > Customize > Custom > Edit Global CSS so you don’t have to add it on every page Settings Tab > Custom CSS. We need the !important to override the inline CSS. Based on CSS specificity, inline CSS will work first. We should update the CSS to this:@media(min-width:980px){ .my-custom-width{ padding-left:100px !important; padding-right:100px !important; } }Please also make sure that you have added the complete code correctly. On contact page, I can see that @media line is missing. You just added this:
.my-custom-width{padding-left:100px;padding-right:100px;}}Hope this helps.
May 4, 2016 at 7:08 pm #913443
arefsParticipantThank you!
May 5, 2016 at 12:06 am #913792
Nabeel AModeratorwelcome 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-908626 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
