:-ms-input-placeholder 在 Windows 7 OS 的 IE9 中不起作用

:-ms-input-placeholder is not working in IE9 in Windows 7 OS

我对 IE9 浏览器中的一个 CSS 问题感到很困惑。我有一个包含 textarea 元素和 placeholder 的网页。我只想 text-align: center; 占位符,

输入文本文本对齐设置为左对齐。

请在下面查看我的编辑。

Html

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style>
        textarea {
            width: 80%;
            height: 80px;
        }

        ::-webkit-input-placeholder {
            text-align: center;
        }

        :-moz-placeholder {
            text-align: center;
        }

        ::-moz-placeholder {
            text-align: center;
        }

        :-ms-input-placeholder {
            text-align: center;
        }
    </style>
</head>
<body>
    <textarea rows="2" cols="21" id='txtnote' class="testplaceholder" maxlength="500" placeholder="Note" onblur=""></textarea>
</body>
</html>

IE 11、Firefox 中一切正常,Chrome 在 Windows 8 中,但是当我查看此网页时 Windows 7 中的 IE9 没用

根据 MSDN,要使此选择器正常工作,您至少需要 IE 10。此外,经过进一步调查后——由于 IE9 不支持它,因此还有其他解决方法可以获取它随心所欲地工作。

请查看此 SO answer or this alternative JS here