Well my problem is that I have a <textarea>
on my page and I use the attribute placeholder=
to give it the user value such that:
<textarea id="usuario_nick" placeholder="usuario">
The problem is that the text inside the textarea is automatically aligned to the left but I want it to be aligned towards the center of the textarea I don't mean only horizontally also vertically right in the center is it possible? Is there a way to move just the value of the placeholder in that textarea as a padding-top y right
?.
I know you can take the placeholder
con ::-webkit-input-placeholder
but this takes all of them and I want it to happen only on 1 specific one.
You just have to put the one
selector
on which you want to modify thepseudo-elemento
::placeholder
. Theselector
can be a class (eg: .miclase
), an id (eg: #miId
), etc.To align it vertically you can specify a
height
specific value for thetextarea
and then the same value for theline-height
delplaceholder
.Yes, you just have to indicate the
padding-top
one you want to apply.For example:
You can access by id.
This would be the code: