2012-09-25 47 views

回答

1

刚刚作出了一个快速演示给你。 CHECK THIS JSFIDDLE

这里我使用背景图像来创建边框。只需调整它!

干杯。

+0

哇,非常棒的解决方案!但只能使用兼容css3的浏览器。也许有另一种方式? – LifeIsShort

+0

Mozilla Firefox(3.6+),Safari/Chrome(1.0/1.3 +),Opera(10.5+)甚至Internet Explorer(9.0+)都支持多种背景功能。足够??? – Libin

+0

你是对的:) IE很烂,只是想确定其他方法。非常感谢! – LifeIsShort

0
img{ 
    float:left; 
} 

这将工作(你应该定义高度和IMG的太宽)

+0

thanx,我知道,但最重要的是图像中的图像之间的线条和间距。 – LifeIsShort

1

也许这样的事情

HTML

<div class="container"> 
    <div class="logo-box" /> 
    <div class="logo-box" /> 
    <div class="logo-box" /> 
    <div class="logo-box" /> 
    <div class="logo-box" /> 
    <div class="logo-box" /> 
    <div class="logo-box" /> 
</div> 

CSS

.container { 
    width:980px; 
    float:left; 
} 
.logo-box { 
    width:245px; 
    float:left; 
    height:150px; 
} 

你可以把任何的.logo-box元素中的HTML标记img或CSS background

0

这似乎是一个很好的解决方案:http://unmatchedstyle.com/news/building-a-client-logo-grid-with-centered-elements.php - 水平居中所有图像与纵 - 易使响应 - 容易定制特定的图像尺寸 - 似乎是非常跨浏览器兼容,甚至有老蹩脚IE的

HTML:

<article class="clients"> 
    <span></span><img src="images/img-logo2.png" alt="logo" /> 
</article> 

<article class="clients"> 
    <span></span><img src="images/img-logo3.png" alt="logo" /> 
</article> 

CSS:

article.clients { 
    float: left; 
    display: table-cell; 
    vertical-align: middle; 
    text-align: center; 
    width: 203px; 
    height: 150px; 
    margin-right: 15px; 
    margin-bottom: 15px; 
    border: 1px solid #4d4d4d; 
    -webkit-border-radius: 3px; 
     -moz-border-radius: 3px; 
       border-radius: 3px; 
} 

article.clients * { 
    vertical-align: middle; 
} 

article.clients span { 
    display: inline-block; 
    height: 100%; 
    width: 1px; 
}