I was wondering if it was possible to center a placeholder and the input which the user will enter in the Text Field. I imagine it would be possible yet I cant figure it out. could anyone help? my code for the Text Field in question is below...
<input type="text" style="font-weight:bold:" name="kword" id="kword" autofocus ="on" placeholder="Enter Keyword(s)" autocomplete ="on"/>
Thanks
Use the line-height property to make the placeholder vertically centered.
You can align the placeholder text (right, left or center) using CSS ::placeholder selector property.
If you only have one or a few blocks of text to center, add the style attribute to the element's opening tag and use the "text-align" property.
The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format). The short hint is displayed in the input field before the user enters a value.
This can be used to text-align:center
CSS:
input, input[placeholder] {
text-align: center;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With