max characters html code example

Example 1: how to specify amout of letters in inputfield in css

<input maxlength="25" placeholder="name" />

Example 2: input max length

<input maxlength="10" />

Example 3: how to limit input type max length

<input name="somename"
    oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
    type = "number"
    maxlength = "6"
 />

Example 4: text limit in html

<span style="
  display:inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 13ch;">
Lorem ipsum dolor sit amet
</span>

Tags:

Html Example