如何將輸入字段的佔位符以HTML格式對齊?中心HTML輸入文本字段佔位符
我使用下面的代碼,但它不工作:
CSS - >
input.placeholder {
text-align: center;
}
.emailField {
top:413px;
right:290px;
width: 355px;
height: 30px;
position: absolute;
border: none;
font-size: 17;
text-align: center;
}
HTML - >
<form action="" method="POST">
<input type="text" class="emailField" placeholder="[email protected]" style="text-align: center" name="email" />
<!<input type="submit" value="submit" />
</form>
你能告訴你的HTML? – Will
不是一個真正的答案,但jQuery Mobile會這樣做,所以你可能想看看他們是如何實現它的。 – Evans
對我來說,當你擺脫'input.placeholder'位時,你的代碼就起作用了。將輸入內部的文本與中心對齊也可以對齊佔位符。 – IamGuest