SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Separating Divs

  1. #1
    SitePoint Member
    Join Date
    May 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Separating Divs

    I am having some css issues with separating divs. On some pages, I am able to do a line break between divs, but on some pages I am not able to do that and I am not sure why this is happening. I have set the width of all the divs that I am using. I have a 3 colum layout with some links boxes on the sides and on a particular page that I have...the links boxes are stuck together, and I can't seem to separate them with a line break. What causes this?

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Rockford, IL
    Posts
    2,361
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Welcome to Sitepoint, Meastman
    Its hard to tell w/o seeing ALL your code. By default tho, DIVs are block elements, this means they cause a line break between each other. However you can stop this from happening by using display:inline or inline-block.

    Most likely you have given the DIV float:left or float:right causing them to sit next each other until on e of them cant fit width wise and that one appears to "wrap down" after a line break

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •