SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Aug 2010
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to evenly distribute 4 divs all lined up in a row...

    I have 4 divs.
    200px wide 100 px tall.
    display: inline-block so they're all on the same line.
    Text Align: center

    So far so good, now I need to give them margins so they can spread out more.

    Site width is 960 and I want the first and last div to be resting up against the first and last pixel of the site. I can't do this if I give them all a margin-right:25px. I know I could just give the first or last div it's own ID and remove the margin, but I was wondering if there is another way?

  2. #2
    SitePoint Addict
    Join Date
    Aug 2010
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    got it...used the last-child property. I've never had to use it before so it didn't immediately come to mind. Cool stuff!


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
  •