Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7542321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:08:08+00:00 2026-05-30T08:08:08+00:00

I run into this problem a lot when making grids of thumbnails, etc. When

  • 0

I run into this problem a lot when making grids of thumbnails, etc. When you try to center using margin: auto;

Normally, I will just use PHP and a counter to style the last object in each row without a margin on the right. But this is somewhat complicated, and I was hoping there might be a simpler way to do it using a CSS trick or something.

I’ve whipped up a stupid little example of the problem here http://jsfiddle.net/convoke/kFzg5/27/

And here’s what I’d like it to look like http://jsfiddle.net/convoke/NZR9X/3/

Subtle difference to the centering of the parent object, but hopefully you see what I mean.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:08:09+00:00Added an answer on May 30, 2026 at 8:08 am

    I replaced floats to inline-blocks + justified “text”:

    http://jsfiddle.net/kFzg5/28/

    Warning: older browsers does not love this technique, and the last row looks fugly.

    Second “solution” with extra wrapper div and much overflow: hidden:

    http://jsfiddle.net/kFzg5/29/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have run into this problem a lot in the past, but never really
Has anyone else run into this problem before? I've got a method that calls
Has anyone run into this problem... In my layout.phtml I have: <head> <?= $this->headTitle('Control
Has anyone run into this problem? I have a collection of comments that I
I have run into this problem before but never quite solved it. I have
All web developers run into this problem when the amount of data in their
I'm really suprised I haven't run into this problem before, but it seems that
I'm hoping someone has run into this sort of problem before, and can give
NOTE: I have solved the majority of this problem but have run into a
I've run into another problem while fixing up my game to use this library.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.