2012-03-04 73 views
0

我得到了一個關於CSS背景圖像的簡單問題。 我的意圖是使用圖像來顯示桌子邊緣的圓角(不使用border-radius屬性)。桌面邊緣的CSS圓角文檔模式中的問題IE7標準

<style type="text/css"> 
    .top 
    { 
     background-repeat:repeat; 
     vertical-align:top; 
    } 

    .left 
    { 
     text-align:left; 
    } 

    .middle 
    { 
    } 

    .right 
    { 
     text-align:right; 
    } 

    .bottomLeft 
    { 
     vertical-align:bottom; 
    } 

    .bottom 
    { 
     background-repeat:repeat; 
     vertical-align:bottom; 
    } 

    .bottomRight 
    { 
     vertical-align:bottom; 
    } 
</style> 

<table cellpadding="0" cellspacing="0" border="0"> 
    <tr> 
     <td class="topLeft"> 
      <img height="16px" src="Images/greenTL.gif" style="vertical-align:bottom" /> 
     </td> 
     <td class="top"> 
      <img height="4px" width="100%" src="Images/greenT.gif" style="vertical-align:8px" /> 
     </td> 
     <td class="topRight"> 
      <img height="16px" src="Images/greenTR.gif" style="vertical-align:bottom" /> 
     </td> 
    </tr> 
    <tr> 
     <td class="left"> 
      <img height="100%" src="Images/greenL.gif"/> 
     </td> 
     <td class="middle"> 
     </td> 
     <td class="right"> 
      <img height="100%" src="Images/greenR.gif"/> 
     </td> 
    </tr> 
    <tr> 
     <td class="bottomLeft"> 
      <img height="16px" src="Images/greenBL.gif" style="vertical-align:top" /> 
     </td> 
     <td class="bottom" > 
      <img height="4px" width="100%" src="Images/greenB.gif" /> 
     </td> 
     <td class="bottomRight"> 
      <img height="16px" width="16px" src="Images/greenBR.gif" style="vertical-align:top"/> 
     </td> 
    </tr> 
</table> 

的HTML & CSS以上至9工作在IE中完全沒有從瀏覽器模式7,但改變文檔模式到IE 7標準當它成爲失真。 這似乎是左右垂直間隙。

enter image description here

我怎樣才能解決這個問題? 在使用CSS3 border-radius之前,實現網頁圓角的最佳方法是什麼?

感謝您的高級。

回答

0

我會使用類似http://css3pie.com/這使< IE9 版本上的一些CSS3功能。就我個人而言,我是那些認爲網頁在所有瀏覽器中看起來不應該100%相同的人之一,例如Chrome/Firefox/Safari應該有圓角,IE9不應該。

0

請勿使用表格進行佈局。對於不支持本機border-radius的瀏覽器中的圓角,可以使用圖形邊角作爲絕對定位的空元素的背景。