Internet Explorer 11 “n” char based width doesn't fit “n” characters

By : AMagyar

I'm building an app which requires a char ("ch") width components. But in IE11 it doesn't seems to be working.

For example:

<input style="width: 5ch; padding: 0; margin: 0; font-family: monospace" maxlength="5">

The width just don't fit 5 characters. Do anyone knows why? I couldn't find the answer anywhere.

Plnkr example here

Edited: I'm using monospace family fonts unlike the another question

By : AMagyar


Better use size attribute:

The size attribute gives the number of characters that, in a visual rendering, the user agent is to allow the user to see while editing the element's value.

input {
  padding: 0;
  margin: 0;
  font-family: monospace;
By : Oriol

This video can help you solving your question :)
By: admin