# Why does password boxes are smaller than text boxes in IE ?

According to Microsoft, whenever Internet Explorer provides the HTML page structure, it uses the wrong character set even after providing the correct character set by the META tag.

HTML part of user input: The following HTML code shows the general password input form which works fine in Google Chrome, Firefox, Microsoft Edge but not in IE. The widths of the input boxes are different in case of IE even if we are specifying “ charset=’UTF-8′ “.

 ` ` `<``html``> ` ` `  `<``head``> ` `  ``<``meta` `charset``=``"UTF-8"``> ` `  ``<``title``>GeeksforGeeks ` ` ` ` `  `<``body``> ` `  ``<``form``> ` `    ``<``p``> ` `      ``<``label``>TEXT INPUT: ` `      ``<``br``> ` `      ``<``input` `type``=``"text"``> ` `      ``<``br``> ` `      ``<``label``>PASSWORD INPUT: ` `      ``<``br``> ` `      ``<``input` `type``=``"password"``> ` `    `` ` `  `` ` ` ` ` `  ` `

Note: The causes for this abnormal behavior of IE are specified in the documentation with the link below.
https://support.microsoft.com/en-us/help/928847/internet-explorer-uses-the-wrong-character-set-when-it-renders-an-html

Solution: It is known that there is some issue with the IE’s default character set.
Let us look into some solutions which are used to overcome this problem.

1. Solution using jQuery: The jQuery code is included in the page load. Make equal-width of text and password input control boxes using jQuery.

 ` ` `<``html``> ` ` `  `<``head``> ` `  ``<``meta` `charset``=``"UTF-8"``> ` `  ``<``title``>GeeksforGeeks ` ` `  `  ``<``script` `src``= ` `"https://code.jquery.com/jquery-3.5.1.min.js"` `    ``integrity``= ` `"sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="` `    ``crossorigin``=``"anonymous"``> ` `  `` ` `   `  `  ``<``script` `type``=``"text/javascript"``> ` `    ``\$(document).ready(function () { ` `      ``\$("input[type='text']").height( ` `        ``\$("input[type='password']").height()); ` ` `  `      ``\$("input[type='text']").width( ` `        ``\$("input[type='password']").width()); ` `    ``}); ` `  `` ` ` ` ` `  `<``body``> ` `  ``<``form``> ` `    ``<``p``> ` `      ``<``label``>TEXT INPUT: ` `      ``<``br``> ` `      ``<``input` `type``=``"text"``> ` `      ``<``br``> ` `      ``<``label``>PASSWORD INPUT: ` `      ``<``br``> ` `      ``<``input` `type``=``"password"``> ` `    `` ` `  `` ` ` ` ` `  ` `

or

 ` ` `<``html``> ` ` `  `<``head``> ` `  ``<``meta` `charset``=``"UTF-8"``> ` `  ``<``title``>GeeksforGeeks ` ` `  `  ``<``script` `src``= ` `"https://code.jquery.com/jquery-3.5.1.min.js"` `    ``integrity``= ` `"sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="` `    ``crossorigin``=``"anonymous"``> ` `  `` ` `   `  `  ``<``script` `type``=``"text/javascript"``> ` `    ``\$(document).ready(function () { ` `      ``\$("input[type='password']").height( ` `        ``\$("input[type='text']").height()); ` ` `  `      ``\$("input[type='password']").width( ` `        ``\$("input[type='text']").width()); ` `    ``}); ` `  `` ` ` ` ` `  `<``body``> ` `  ``<``form``> ` `    ``<``p``> ` `      ``<``label``>TEXT INPUT: ` `      ``<``br``> ` `      ``<``input` `type``=``"text"``> ` `      ``<``br``> ` `      ``<``label``>PASSWORD INPUT: ` `      ``<``br``> ` `      ``<``input` `type``=``"password"``> ` `    `` ` `  `` ` ` ` ` `  ` `

2. Solution using CSS: Fix the width of both the input controls to some value depending on your project. Here “14em” width is used, just change this to the value of desired width.

 ` ` `<``html``> ` ` `  `<``head``> ` `  ``<``meta` `charset``=``"UTF-8"``> ` `  ``<``title``>GeeksforGeeks ` `  ``<``style` `type``=``"text/css"``> ` `    ``input { ` `      ``width: 14em; ` `    ``} ` `  `` ` ` ` ` `  `<``body``> ` `  ``<``form``> ` `    ``<``p``> ` `      ``<``label``>TEXT INPUT: ` `      ``<``br``> ` `      ``<``input` `type``=``"text"``> ` `      ``<``br``> ` `      ``<``label``>PASSWORD INPUT: ` `      ``<``br``> ` `      ``<``input` `type``=``"password"``> ` `    `` ` `  `` ` ` ` ` `  ` `

3. By setting the default font family for inputs: (Most liked solution) This method uses same font family for all the inputs.

 ` ` `<``html``> ` ` `  `<``head``> ` `  ``<``meta` `charset``=``"UTF-8"``> ` `  ``<``title``>GeeksforGeeks ` `  ``<``style` `type``=``"text/css"``> ` `    ``input { ` `      ``font-family: sans-serif; ` `    ``} ` `  `` ` ` ` ` `  `<``body``> ` `  ``<``form``> ` `    ``<``p``> ` `      ``<``label``>TEXT INPUT: ` `      ``<``br``> ` `      ``<``input` `type``=``"text"``> ` `      ``<``br``> ` `      ``<``label``>PASSWORD INPUT: ` `      ``<``br``> ` `      ``<``input` `type``=``"password"``> ` `    `` ` `  `` ` ` ` ` `  ` ` My Personal Notes arrow_drop_up Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
{"ft_lang_label":"__label__en","ft_lang_prob":0.55402243,"math_prob":0.4373992,"size":5271,"snap":"2020-34-2020-40","text_gpt3_token_len":1537,"char_repetition_ratio":0.1456237,"word_repetition_ratio":0.44878563,"special_character_ratio":0.3166382,"punctuation_ratio":0.10571081,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98698753,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-09-27T05:00:37Z\",\"WARC-Record-ID\":\"<urn:uuid:5e76dd2c-1db8-4184-99eb-5d74577337c6>\",\"Content-Length\":\"137036\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:26626167-ea4f-48a7-a0d6-23071e45bfe8>\",\"WARC-Concurrent-To\":\"<urn:uuid:c954ea09-df98-4d5e-aeee-5a0c41bef6bb>\",\"WARC-IP-Address\":\"23.199.71.208\",\"WARC-Target-URI\":\"https://www.geeksforgeeks.org/why-does-password-boxes-are-smaller-than-text-boxes-in-ie/\",\"WARC-Payload-Digest\":\"sha1:KVXVQE7KFWUAFGT3OFQ6AH2KH3WHJ2FZ\",\"WARC-Block-Digest\":\"sha1:N63YPYVCBC2GDBXVFVOAAESSQ25OYMY3\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-40/CC-MAIN-2020-40_segments_1600400250241.72_warc_CC-MAIN-20200927023329-20200927053329-00103.warc.gz\"}"}