i have a problem in that i set a img as a background to a table , see below
我有一个问题,我将img设置为表的背景,见下文
<table id ='outertable' style="background: url(courierimages/biglogo.jpg) no-repeat center;opacity:0.2;filter:alpha(opacity=20);">
<tr>
<td>
<table id = 'innertable'>
<tr>
<td><input type = "text"></td>
</tr>
</table>
</td>
</tr>
</table>
Here the opacity applies to the inner table too. But i need it for outertable only.Please guide on this , Thanks in advance.
这里不透明度也适用于内表。但我只需要它就可以了。请指导一下,提前致谢。
2 个解决方案
#1
The opacity applied on parent element will be always inherited by it's children.
应用于父元素的不透明度将始终由其子元素继承。
There are some hacks that works with IE, but it's not a good solution...
有一些黑客适用于IE,但它不是一个好的解决方案......
#2
Explicitly set a background-color on your inner table using css eg. add following to your stylesheet
使用css在内表上明确设置背景颜色,例如。在样式表中添加以下内容
#innertable background-color:#fff
#1
The opacity applied on parent element will be always inherited by it's children.
应用于父元素的不透明度将始终由其子元素继承。
There are some hacks that works with IE, but it's not a good solution...
有一些黑客适用于IE,但它不是一个好的解决方案......
#2
Explicitly set a background-color on your inner table using css eg. add following to your stylesheet
使用css在内表上明确设置背景颜色,例如。在样式表中添加以下内容
#innertable background-color:#fff