http://www.zhangxinxu.com/study/201306/pseudo-elements-to-style-placeholder-attribute.html
CSS代码:
[placeholder] { font-family: 'Microsoft yahei'; } ::-moz-placeholder { color: mediumvioletred; text-indent: 5px; /* 没有用 */ opacity: 1!important; } :-ms-input-placeholder { color: mediumvioletred; text-indent: 5px; } ::-webkit-input-placeholder { color: mediumvioletred; text-indent: 5px; }
HTML代码:
<input placeholder="占座" />