I'm trying to align the ::placeholder pseudo-element using Flexbox.
I'm aware of traditional ways of alignment, like text-align for inline alignment, the line-height hack for block alignment, or simply absolute positioning. I am not interested in those.
Flexbox works fine for aligning ::before and ::after pseudo-elements (try it!). But somehow it doesn't work for aligning the ::placeholder pseudo-element of <textarea> and <input> elements.
Why?
textarea {
height: 10rem;
display: flex;
/* should put it center center */
align-items: center;
justify-content: center;
}
input {
height: 10rem;
display: flex;
/* should put it top center */
align-items: flex-start;
justify-content: center;
}
<textarea placeholder="Some text"></textarea>
<input placeholder="Some text" />