I used rtl direction (for persian language) in html tag for whole document. But I have some input element for username or email address (as you know, these are english and must be ltr). I google and find some script for auto-direction. They worked, but if I have rtl placeholder for input, the placeholder text also will be ltr!
Can you guide me?
I want something like this:
[sample]: http://sumdroid.pe.hu/sample.jpg "please see this image"
whole document is rtl, placeholder is rtl, but input element insert is ltr.
Using the browser specific pseudo calls to the placeholder should sort your issue out
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;
}
.input{
direction: rtl;
}
.input:focus{
text-align: left;
direction: ltr;
}
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