Consider the following example: (Live demo here)
HTML:开发者_StackOverflow中文版
<div id="wrapper">
<textarea></textarea>
</div>
CSS:
div {
background-color: #777;
}
textarea {
background-color: inherit;
}
I would like the textarea
to inherit the background color from the wrapper.
It works well in Firefox.
But, in Internet Explorer 7, the background color is white. Why ?
How could I fix that ?
IE7 does not support inherit
for any properties besides direction
and visibility
.
Source.
You could set the textarea
's background-color
to transparent
instead.
精彩评论