beennn Posted November 13, 2012 Share Posted November 13, 2012 How can I stop the padding on a div from stacking? By this I mean, I have several of the same div next to one another with a padding of 30px, as the divs are placed next to each other, this gives a gap of 60px between them, and only a gap of 30px between other elements. How can I make sure only 30px is on each side and stop there padding from stacking? Link to comment Share on other sites More sharing options...
DarkxPunk Posted November 13, 2012 Share Posted November 13, 2012 It is not stacking it's following exactly what you are telling it. If you put padding 30 on a div and repeat it you will have this|30(div)30|30(div)30| exactly as you specified. I would create a class specifically for the divs that will be side by side and one for divs beside other elements. Link to comment Share on other sites More sharing options...
ShadowMage Posted November 13, 2012 Share Posted November 13, 2012 Or use margins. Margins should collapse into a single margin where they meet. Link to comment Share on other sites More sharing options...
beennn Posted November 13, 2012 Author Share Posted November 13, 2012 Thank you very much Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now