Home > other >  Is there a way to give each line a separate style when wrapping a textarea's placeholder?
Is there a way to give each line a separate style when wrapping a textarea's placeholder?

Time:08-26

I'm developing a simple board with React.

However, I am working on a textarea and I want to change the font-weight of each after a line break for the placeholder.

I know how to handle a line break, but I don't know how to give it a style after that.

Is there any way?

<textarea id='contents' placeholder="Title&#13;&#10; ex)Date,Content..."></textarea>

I'm &#13;&#10; As a standard, I would like to change the title's font-weight from 700 ex to 400. Is there a way?

CodePudding user response:

With <textarea> I don't think this is possible in any way.
You can however use contenteditable

CodePudding user response:

sandbox demo

::placeholder {
  color: blue;
  font-weight: 400;
}
  • Related