Aligning multiple images horizontally in the center of a div?

Floating a block level item will push it to the left or right. "display:inline-block" on the IMG. And remove the float and position statements.

Then "text-align:center" for the container div.

Up vote 0 down vote favorite share g+ share fb share tw.

I have a div and I want to align in the center of that div multiple images. All of the images have the same height and width of 16px. The problem is that I can either center them and have the extra space below but when I use the display:block to remove it, they are aligned to the left again.

Here's my code: div which I want to contain the images: . Cell{ position: relative; float: left; width: 300px; min-height: 22px; border-bottom: 1px solid #000; border-right: 1px solid #000; line-height: 22px; font-family: Arial, Verdana; font-size: 12px; color: #000; text-decoration: none; text-align: center; margin-bottom: 2px; margin-right: 2px; } The above class has the properties needed in general. So I want to create a class for the img elements so that they can be aligned one next to each other and all together aligned horizontally.

Any working suggestions?! :) html css image center align link|improve this question asked Feb 24 at 16:08Jonur476 50% accept rate.

– yunzen Feb 24 at 16:12 Here's a fiddle I put together. Just to get things moving: jsfiddle.net/ah2Uw – thepriebe Feb 24 at 16:16 So do you want to have the div hug the images at the bottom? I'm confused as to what you really want done here.

You have min-height: 22px;, so there's going to be extra space at the bottom since your images are 16px. – thepriebe Feb 24 at 16:19 thepriebe you were correct. In your solution I just added height and width of my cell and all worked correctly.

Thank you for your quick reply! :) – Jonur Feb 24 at 16:49.

Floating a block level item will push it to the left or right. "display:inline-block" on the IMG. And remove the float and position statements.

Then "text-align:center" for the container div. jsfiddle.net/B6Jsy/ I used a div as a fake img but it should work the same.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions