Aligning multiple images horizontally in the center of a div

前端 未结 2 1449
深忆病人
深忆病人 2020-12-14 01:47

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

2条回答
  •  渐次进展
    2020-12-14 02:06

    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.

    http://jsfiddle.net/B6Jsy/

    I used a div as a fake img but it should work the same.

提交回复
热议问题