: -ms-input-placeholder does not work in IE9 on Windows 7

I am really confused about the CSS issue in IE9 browser. I have a webpage with a textarea element with placeholder . I want text-align: center; seat holder

enter image description here

text-align text input is set to the left.

enter image description here

See my changes below.

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> 

Everything works fine in IE 11, Firefox, Chrome on Windows 8 . But when I look at this webpage on IE9 in Windows 7 it doesn’t work

+5
source share
1 answer

According to MSDN , in order for this selector to work, you need to have at least IE 10. In addition, after further investigation - since it is not supported in IE9, there are other workarounds to make it work as you wish.

Please check out this SO answer or this alternative JS here .

0
source

Source: https://habr.com/ru/post/1238136/


All Articles