显示图像水平CSS [英] Displaying images horizontally CSS

查看:302
本文介绍了显示图像水平CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Imhaving在我的网站有点难度与CSS样式,现在我有一个排,我想水平对齐沿着我的页面图像。但就现在它在一排显示他们所有垂直和我不知道为什么。所有的图像都存储在一个阵列,它只是得到他们一字排开,这就是问题所在。 这里是我的code:

  .IMG {
浮动:左;
宽度:120px;
保证金:汽车;
保证金左:10px的;
填充:5px的;
}
 

解决方案

您应该添加到您的样式显示:inline-block的。该 inline-block的值使,你.IMG是不是一个新的行结束时显示。

Imhaving a bit of difficulty with CSS styling on my website, Currently I have a row of images that I'd like to align horizontally along my page. But just now it displays them all vertically in a row and I'm not sure why. All the images are stored in an array, it's just getting them lined up that's the problem. here is my code:

   .img{
float:left;
width:120px;
margin:auto;
margin-left:10px;
padding:5px;
}

解决方案

You should add the to your style display:inline-block. The inline-block value makes, that your .img is not displayed with a new-line at the end.

这篇关于显示图像水平CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆