[英]CSS box in Internet Explorer
I've a rendering problem to show a box with background image and border image in IE8 IE7 IE6 我有一个渲染问题,要在IE8 IE7 IE6中显示带有背景图像和边框图像的框
My code works in IE9, Safari, Firefox. 我的代码可在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;
}
I've founded a solution to put left and right image in a table: 我已经建立了一种解决方案,可以将左右图像放在表格中:
CSS: CSS:
table {
height: 50px;
position:relative;
}
.myBox {
background : url(images-center.png) repeat-x;
}
html: 的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>
Anyone have a better and elegant solution???? 有人有更好更好的解决方案吗????
Here are two ways to do it 这是两种方法
Of-course your method is valid just as well, although it causes you to change your markup.. 当然,您的方法同样有效,尽管它会导致您更改标记。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.