Forum Moderators: not2easy
var input = document.getElementById('input');
var output = document.getElementById('output');
input.addEventListener('input', function() {
output.value = input.value;
});
output {
display: block;
font: 20px Arial;
outline: 1px solid green;
}
<input id="input">
<output id="output"></output>
<input id="input">
<output id="output"> </output>
output {
display: block;
font: 20px Arial;
height: 20px; //<-- set height to prevent collapse
outline: 1px solid green;
line-height:1.35; //<--- set line-height to ensure that height is constant across broswers.
}
Would you mind elaborating?Your sites are presumably viewed by a variety of humans on a variety of devices, viewed from a variable distance. (If all of your users are 19-year-olds with 20-20 visions using the machines in their school's computer lab, disregard the rest of this post.) Because of this, many of your human users have set a preferred font and/or size in their browser. Depending on the human, it may be larger or smaller than what the site designer perceives as normal text size. This is what you get when the CSS says "100%" or "medium". When the CSS instead says "125%" or "80%" or "x-small" or what-have-you, the browser calculates a proportion of the human viewer's default size.