sphinx Posted March 27, 2014 Share Posted March 27, 2014 Hello. My site mobile theme has a overall padding of 10px, however, this isn't displaying my mobile ads correctly. I have the advert codes wrapped like this: <div class="googlead"> <!-- ad code here --> </div> This is the @media main css: .content-wrap{ line-height: 150%; font-size: 15px; padding: 10px; background-color: #ffffff; } Is it possible to make ".content-wrap{" ignore the googlead class so that I can specify a 0% padding as required. Could I use :not in this instance? Cheers. Link to comment https://forums.phpfreaks.com/topic/287341-ignore-default-padding-rule-on-a-class/ Share on other sites More sharing options...
OrionSuperman Posted March 27, 2014 Share Posted March 27, 2014 I'm fairly new to HTML/CSS so if my solution is wrong I apologize. Due to the order of precedence in CSS, why do you not just add another CSS tag specifically for .googlead and set its padding to 0px? That should over-ride any inherited padding it has acquired. Link to comment https://forums.phpfreaks.com/topic/287341-ignore-default-padding-rule-on-a-class/#findComment-1474181 Share on other sites More sharing options...
sphinx Posted March 27, 2014 Author Share Posted March 27, 2014 I'm fairly new to HTML/CSS so if my solution is wrong I apologize. Due to the order of precedence in CSS, why do you not just add another CSS tag specifically for .googlead and set its padding to 0px? That should over-ride any inherited padding it has acquired. This doesn't seem to address the issue. Thank you for trying anyhow. Link to comment https://forums.phpfreaks.com/topic/287341-ignore-default-padding-rule-on-a-class/#findComment-1474186 Share on other sites More sharing options...
Strider64 Posted March 28, 2014 Share Posted March 28, 2014 .content-wrap { box-sizing: border-box; /* more code here... */ } Maybe doing something like this? Though looking at the problem again probably not. Link to comment https://forums.phpfreaks.com/topic/287341-ignore-default-padding-rule-on-a-class/#findComment-1474279 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.