簡體   English   中英

Internet Explorer中的CSS框

[英]CSS box in Internet Explorer

我有一個渲染問題,要在IE8 IE7 IE6中顯示帶有背景圖像和邊框圖像的框

我的代碼可在IE9,Safari,Firefox中使用。

.myBox {
background : url(image-left.gif) left no-repeat,url(image-right.gif) right no-repeat, url(images-center.png) repeat-x;
height: 50px;
position:relative;
}

我已經建立了一種解決方案,可以將左右圖像放在表格中:

CSS:

table {
    height: 50px;
    position:relative;
}

.myBox {
    background : url(images-center.png) repeat-x; 
}

的HTML:

<table cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td><img src="image-left.gif" /></td>

    <td>my content text</td>

    <td><img src="image-right.gif" /></td>
</tr>
</table>

有人有更好更好的解決方案嗎????

這是兩種方法

當然,您的方法同樣有效,盡管它會導致您更改標記。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM