I have this div:
main.css(external):
#content{
padding:35px;
}
Then I php include another html inside that div:
<div id="content"><?php include "news.html"?></div>
Inside news.html I want my #poll div to not include padding, when loaded inside #content.
#poll{
padding:0px;
}
Is that possible? For some reason setting inline css for #poll doesn’t work.
You can use a negative margin on
#pollto undo the padding of the containing div. See: http://jsfiddle.net/635A4/1/Also see the comment in the CSS, it’s important if you have more elements in the flow that you set a positive bottom margin (and sometimes even top) to make sure the flow doesn’t get disturbed.
In fact, I use this a lot to give a content box a padding, but have the block-style title touch the edges anyway without having to use extra wrapper elements.