Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6141111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:12:18+00:00 2026-05-23T18:12:18+00:00

Taken directly from W3Schools : Definition and Usage The size attribute specifies the width

  • 0

Taken directly from W3Schools:

Definition and Usage The size attribute specifies the width of an
input field.

For <input type="text"> and <input type="password">, the size
attribute defines the number of characters that should be visible. For
all other input types, size defines the width of the input field in
pixels.

So..

If that is true why is my field <input type="text" size="2"/> wide enough to display 5 CAPTIAL MMMMM’s ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:12:18+00:00Added an answer on May 23, 2026 at 6:12 pm

    The same “erroneous” information is specified in the HTML4 Spec, the HTML5 spec, Sitepoint, Mozilla Developer Network, and Microsoft’s MSDN library. So it isn’t just W3Schools’ fault.

    Anyway, while the specs say that the size attribute should be the number of characters visible, most web browsers have settled on using the number of em units, meaning the width of the character of the capital M.

    To specify the width precisely in pixels, or any unit of your choice, use the CSS width property.

    To answer your updated question: it’s the width of the capital M in the default font size as applied by CSS styling to the text box, but the font size of the text inside the text box is usually smaller.

    Want to make a set number of characters fit inside the box? You’ll have to switch to a fixed width font.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an input field that autocompletes using text taken from a PHP page.
Example taken from Mozilla's help page <script type="text/javascript"> re = /(\w+)\s(\w+)/; str = "John
This is taken directly from my Django template: {% for day in days %}
This code is taken from a previous question, but my question directly relates to
Hi I am using a table manipulation (sorting) script taken directly from Learning jQuery
The code below is taken directly from the sample project accompanying the article on
I have taken an image from UIImagePickerController , but the file looks too big
I've taken the plunge and upgraded (or maybe downgraded?!) from WinXP to Vista. Everything
I've taken over a mixed PHP4/PHP5 project which has been handed down from developer
I'm working with a C# sample application (taken from here : http://www.piccoder.co.uk/content/view/42/26/1/4/ ) The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.