::placeholder
pseudo-element is still in the development stage and has limited support for CSS properties.
All properties that work with the ::first-line pseudo-element also apply to the ::placeholder pseudo-element.
While no additional properties are officially listed, there have been requests for the inclusion of text-align
.
With only a handful of supported properties available (referenced here), achieving this request may be possible if your placeholder text consists of just one word.
By leveraging the supported word-spacing
property by adding a character before hiding it.
However, implementation without browser prefixes might not yield the desired result.
input {
width: 200px;
background-color: #fff!important;
}
input::placholder {
word-spacing: 155px;
}
input::placholder:first-letter {
color: #fff!important;
}
<input type="text" name="airline_search" style="direction: ltr; border: none;" placeholder="- ارلاین">
This approach should function appropriately.
input::-webkit-input-placeholder {
/* WebKit browsers */
word-spacing: 155px;
}
/* Additional browser support */
input:-moz-placeholder,
input::-moz-placeholder,
input:-ms-input-placeholder {
word-spacing: 155px;
}
input::-webkit-input-placeholder::first-letter {
color: #fff!important;
}
input:-moz-placeholder:first-letter,
input::-moz-placeholder::first-letter,
input:-ms-input-placeholder::first-letter {
color: #fff!important;
}
<input type="text" name="airline_search" style="direction: ltr; border: none;" placeholder="- ارلاین">
Given the unpredictable nature of browser support, experimenting with various methods may be necessary.
Note that direction: ltr;
primarily affects cursor position and text flow, which may not apply to placeholders due to their lack of editability.