2012-06-20 29 views
0

我有以下的情況下,跨度對齊方式:編輯 :去掉鏈接CSS在IE7

在IE7中給了我不同的看法 - 這三個元素沒有頂部對齊。 在其他瀏覽器中,代碼看起來不錯。

請提出如何處理三個元素的對齊?

HTML代碼:

<html> 
<head> 
    <title> Text </title> 
    <link href="/css/style.css" rel="stylesheet" type="text/css" /> 
</head> 

<body> 
    <div class="button-like"> 
    <a href=""> 
     <span class="left-button"></span> 
     <span class="right-button"></span> 
     Text text text 
    </a> 
</div> 
</body> 
</html> 

CSS代碼:

.button-like{ 
margin: 0 0 20px 0; 
/* Elipsis */ 
    white-space: nowrap; 
    width: 100%; /*IE 6*/ 
    overflow: hidden; 
    text-overflow: ellipsis;} 

.button-like a{ 
    max-width: 410px; 
margin-left: 35px; 
margin-right: 35px; 
padding: 0 40px; 
position: relative; 
height: 38px; 
color: #52455f; 
text-decoration: none; 
line-height: 40px; 
display: inline-block; 
background: url("/imgs/button-tile.png") 0 0 repeat-x transparent; 
} 

.left-button{ 
left: -35px; 
position: absolute; 
width: 35px; 
height: 38px; 
background: url("/imgs/button-left.png") 0 0 no-repeat transparent; 
} 

.right-button{ 
left: auto; 
right: -35px; 
position: absolute; 
width: 35px; 
height: 38px; 
background: url("/imgs/button-right.png") 0 0 no-repeat transparent; 
} 
+1

我無法顯示您所提供的鏈接。花費太多時間。編輯:也許提供一個jsfiddle並在這裏粘貼最小的代碼? – FelipeAls

+0

您應該在您的問題中發佈[簡短,自包含示例](http://sscce.org/)代碼,以便其他人在修復您的網站後可以獲得幫助。此外,您可以在[JSFiddle](http://jsfiddle.net)中發佈相同的代碼,以便我們可以看到問題的實際示例。 – saluce

+0

編輯,刪除的鏈接,也會在JSFiddle中嘗試 - 但是它會在IE7中工作嗎? – user1408669

回答