2
Good afternoon. I’m doing an activity in college where I need to limit a text field to 100 characters, but I have to use only CSS for this.
I’ve tried these two ways:
Example 1:
.es1[type="text"]{
background-color: rgb(173,234,234);
font-weight: bolder;
width: 20ch;
Example 2:
.es1[type="text"]{
background-color: rgb(173,234,234);
font-weight: bolder;
max-width: 20ch;
But I couldn’t. I thank you ;)
With CSS??? You’ll never get that. You probably missed some of the activity.
– LeAndrade
The attribute is commonly used
input[maxlength]
ortextarea[maxlength]
. But CSS I’ve never seen.– fernandosavio
if used
max-width: 15ch;
andoverflow: hidden;
, you can delimit the number of lines for certain tags, such as<p>
, but not a value input field– Gabriel Gonçalves