Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

adding spacing between two divs inside a parent div

 
Sunny Gibbony
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know how to add spacing between two divs that are under a parent div.

To help visualize, you would have one big box. Inside that are two smaller boxes (divs) that I have and now I would like to add some space between the two child divs.



Thanks
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
margin-top or maring-bottom

Eric
 
Sunny Gibbony
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eric Pascarello:
margin-top or maring-bottom

Eric


Eric,

I forgot to mention that the divs are side by side using the float: left attribute. Would that change your response?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Might you think margin-left and margin-right?

Be aware that sometimes margins are ignored when floating elements, You may also have to explore using padding.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic