在HTML中对齐图像组

时间:2013-10-09 19:02:33

标签: html css image alignment

<img src="abroad.jpg" alt="country" width="495" height="262.5">

<img src="bubbles.jpg" alt="colourful" width="495" height="262.5">

<img src="butterflies.jpg" alt="nature" width="495" height="262.5">

对于此代码,如何对齐所有图像,使它们位于页面的中央而不是左侧?

1 个答案:

答案 0 :(得分:1)

尝试

img {
  display: block;
  margin: 0 auto;
}

http://jsfiddle.net/5dT66/