how to in styled input
tag placeholder extends that parent style and i want to have right direction
in left
styled input.
for example this is my input:
<input type="password" style='direction:ltr;text-align:left;' id="password" placeholder="password">
placeholder text-align is left now. how to use direction:rtl
for that?
In most of the browsers, placeholder texts are usually aligned in left. The selector uses text-align property to set the text alignment in the placeholder. This selector can change browser to browser.
Move the mouse pointer over the slanted lines. When a four-headed arrow appears over the borders, click and drag the placeholder to a new location.
I think this can help you.
input[type="text"]:-moz-placeholder {
text-align: right;
}
input[type="text"]:-ms-input-placeholder {
text-align: right;
}
input[type="text"]::-webkit-input-placeholder {
text-align: right;
}
Demo
According to the docs: (http://www.w3.org/html/wg/drafts/html/master/forms.html#the-placeholder-attribute)
In situations where the control's content has one directionality but the placeholder needs to have a different directionality, Unicode's bidirectional-algorithm formatting characters can be used in the attribute value:
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