How to limit input text length using CSS3?

css, html, input

Solution

You cannot use CSS to limit the number of input characters. That would be a functional restriction, and CSS deals with presentation.

Problem

Possible Duplicate: Can I specify maxlength in css? In my CSS I use this code to make round borders for all the input tags in my site. I wonder if it is possible to limit the lenght of the input in the same way (for example 50 characters) ``` input { border-radius: 10px; -moz-border-radius: 10px; -khtml-border-radius: 10px; -webkit-border-radius: 10px; } ``` I imagine something like (this is not working): ``` input { max-lenght: 50; } ``` Any sugestions? Thank you very much! EDIT: This question is about how many characters can the user write into the field, not the visible size of the input

Original source

Related problems