我对这件事很困惑。我试图让 div 中的文本区域在 IE7、IE8 和 IE9 中工作,但不小心我将样式背景从无更改为颜色。这使它起作用。
谁能解释一下?
对于困惑的设置,我深表歉意。在了解背景问题后,会将所有样式提升到 css 文件。
不起作用
<textarea id="chatWindowMessageArea" style="position: absolute; display: block; margin: 0;
padding: 0; border: none; float: none; clear: none; left: 35px; top: 302px; width: 315px;
max-width: 315px; min-width: 315px; height: 63px; max-height: 63px; min-height: 63px;
z-index: 2; background-color: transparent; background: none; font-style: normal;
font-weight: normal; font-size: 100%; line-height: normal; text-shadow: none;
list-style: none; text-align: left; outline: none; text-indent: 0px; -moz-box-shadow: none;
-webkit-box-shadow: none; font-family: arial,sans-serif; font-size: 12px; font-weight: normal;
color: black; vertical-align: top; resize: none; overflow: auto;" type="text"
name="chat">
</textarea>
有效!
<textarea id="chatWindowMessageArea" style="position: absolute; display: block; margin: 0;
padding: 0; border: none; float: none; clear: none; left: 35px; top: 302px; width: 315px;
max-width: 315px; min-width: 315px; height: 63px; max-height: 63px; min-height: 63px;
z-index: 2; background-color: transparent; background: #FFFFFF; font-style: normal;
font-weight: normal; font-size: 100%; line-height: normal; text-shadow: none;
list-style: none; text-align: left; outline: none; text-indent: 0px; -moz-box-shadow: none;
-webkit-box-shadow: none; font-family: arial,sans-serif; font-size: 12px; font-weight: normal;
color: black; vertical-align: top; resize: none; overflow: auto;" type="text"
name="chat">
</textarea>
最佳答案
background: none
表示您的背景将完全透明。
因此,没有任何东西可以点击;您实际上是在点击隐藏框后面的任何内容。
关于html - 为什么我需要设置背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23496891/