aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes adding spacing between two divs inside a parent div Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "adding spacing between two divs inside a parent div" Watch "adding spacing between two divs inside a parent div" New topic
Author

adding spacing between two divs inside a parent div

Sunny Gibbony
Ranch Hand

Joined: May 14, 2008
Posts: 39
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
margin-top or maring-bottom

Eric
Sunny Gibbony
Ranch Hand

Joined: May 14, 2008
Posts: 39
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

Joined: Jan 10, 2002
Posts: 60082
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: adding spacing between two divs inside a parent div
 
Similar Threads
line breaks
Simple CSS puzzle?
Absolute set Div with z-index Problem
Doubt on Tabbed menu approach
how to get HTML div id name from RootPanel