size in Characters,not display width

thesizeattribute of the element contribute size of the input field input characters. 이는 디스플레이 크기에 영향을 줄 수 있지만 다소 간접적입니다. 디스플레이 관점에서 한 문자는1 em와 같습니다(실제로는emCSS 단위의 정의입니다)., 즉,폭이 변화에 따라서 글꼴 크기가 모두font-size속성(12 pt대 14pt) and the relative size of the font being used (Arialvs.돋움`,예를 들어). 그러나size속성은 실제로 잠재적 인 항목의 길이를 제한하지 않습니다. 예를 들어,만약 당신이 원하는 분야를 위해 4-digit PIN 번호가 다음에 대해 충분하지 않는 PIN 입력만 네 개의 자리입니다.,

<form> <label for="pin">PIN</label><br> <input name="pin" size="4"><br> <input type="submit"> </form> 

이 때문에,size속성은 종종 가장 좋은 방법입니다. 실제 디스플레이 크기는 다를 수 있으며 사용자가 원하는 것보다 더 많이 입력 할 수 있습니다. 대부분의 경우,그것은 일반적으로 사용하는 것이 좋 CSS 을 제어하는 크기(필요한 경우)maxlength의 수를 제어하는 문자 입력에 의해 사용됩니다. 를 사용하는size보완maxlength또한 의미에서,특히,일반 스타일이 적용되지 않은 형태입니다.,

<form> <label for="pin2">PIN</label><br> <input name="pin2" size="4" maxlength="4"><br> <input type="submit"> </form> 
Adam is a technical writer who specializes in developer documentation and tutorials.