brizzle Posted April 4, 2020 Share Posted April 4, 2020 Site URL: https://www.dfwmicropigmentation.com Hi ya'll, Is it possible to style only for mobile/iPhone? For example, I hav the following css for controlling padding on my home page, but I want to decrease the padding-top a little more for iPhone: div#home-page { padding-top:10px; padding-left:0px; padding-right:0px; } Do you use the same code again, but wrapped in a css for mobile? How is that done correctly? Thanks so much! Link to comment
tuanphan Posted April 5, 2020 Share Posted April 5, 2020 Wrap your CSS in @media query for iPhone. https://css-tricks.com/snippets/css/media-queries-for-standard-devices/ If you want to apply on Mobile, wrap in this query @media screen and (max-width:640px) { your CSS here } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
brizzle Posted April 17, 2020 Author Share Posted April 17, 2020 Thanks Tuanphan for the feedback! I've tried adding the following to the css under the Design section and for whatever reason it's not changing the amount of space on the top of the div (either margin, or padding): @media screen and (max-width:640px) { div#home-page { margin-top:0px; padding-top:0px; padding-left:0px; padding-right:0px; } } div#home-page { padding-top:7px; padding-left:0px; padding-right:0px; } Please see the attached screenshots. Any ideas on how to get it to respond correctly? Is there a separate div for mobile?? Thanks Link to comment
tuanphan Posted April 17, 2020 Share Posted April 17, 2020 Use this code /* destkop padding */ div#home-section .page-content { padding-top: 0; } /* mobile padding */ @media screen and (max-width:640px) { div#block-yui_3_17_2_1_1585965744269_13769 { padding-top: 0 !important; } } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.