Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Even with margin and padding set, no space between left column divs

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #40970
    simplykells
    Participant

    Hello i’m sure its simple but I cannot figure it out. I want to get spacing between my reel div and about div (left column div is the main div)

    http://www.simplykells.com/test2.html
    http://www.simplykells.com/test2.css

    #115335
    wolfcry911
    Participant

    Instead of a top margin on the about div, put a bottom margin on the reel div. The reason is that because #reel is a float, its taken out of the document flow; #about’s margin is ‘lost’ beneath the #reel div (a margin larger than #reel’s height would show this). However, a float’s margin will push other elements.

    #115364
    simplykells
    Participant

    k thanks, that makes sense. The bottom margin does work, with the text about. The problem is that when i place a border around about div, there is no spacing between the divs???

    #115366
    wolfcry911
    Participant

    Again, because #reel is a float, it’s removed from the document flow and #about’s box actually begins at the top of #reel (the float only displaces inline content).

    So, is there a reason #reel is a float to begin with? If not, you could remove and the margin and border will work to your liking. Or, you could make #about a float as well and the margin and border would work between them, but may cause problems below #about.

    #115368
    simplykells
    Participant

    that did it!!! I removed the float. I taught myself css, and have very limited knowledge, so i figured i had to always use float when having items side by side. Thank you so much!!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.