Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Does the <input> placeholder have a maximum length?

I have an input field in HTML and I’m having the problem that the text I entered as a placeholder isn’t fully displayed.

<input id="test" placeholder="Stadt oder Postleitzahl eingeben">

I already tried applying margin and padding to my input field but that didn’t fix my problem. So my question is whether the input placeholder has a maximum character length or how can I fix this?

#test {
    padding-right: 100px;
}
<input id="test" placeholder="Stadt oder Postleitzahl eingeben">

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

When the width of the input element isn’t enough to fit the placeholder, it will be cut off.

#test {
  width: 250px;
}
<input id="test" placeholder="Stadt oder Postleitzahl eingeben">
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading