imironchik Posted October 1, 2012 Share Posted October 1, 2012 Hello. Can anybody explain me how can I set distance between two <div> in a container? Look at the example: <div id="container"> <div id="item1"></div> <div id="item2"></div></div> I need a distance between item1 and item2. I've already played with top, bottom, margin, but nothing help me. Then how? Link to comment Share on other sites More sharing options...
Ingolme Posted October 1, 2012 Share Posted October 1, 2012 You can use margins to add more separation between elements. Link to comment Share on other sites More sharing options...
eTianbun Posted October 2, 2012 Share Posted October 2, 2012 (edited) Where is the CSS for item1 & item2? Using margin top | bottom should fix that, except there is/are ERROR(s) in you® CSS. Edited October 2, 2012 by CodeName Link to comment Share on other sites More sharing options...
oknoorap Posted October 4, 2012 Share Posted October 4, 2012 I suggest : <div id="container"> <div id="item1" class="container-item"></div> <div id="item2" class="container-item"></div></div> and your css is : #container .container-item { display: block; margin: 5px 0;} 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