I have some code:
<div class="txt-input">
<input id="txt-enter" type="text" placeholder="Enter To-Do">
</div>
But the placeholder is stuck to the left of the border.
I want to have it 10px to the right, how do you do that?
I do have a CSS file as well.
I tried ::placeholder but that didn’t work. I also tried margin-left: 10px; put that didn’t work either.
2
Answers
You can use
::placeholder
selector to set css for placeholder of input or textare.You’re correct in using ::placeholder, you just need to using padding-left and not margin-left