HTML & CSS References
HTML Input Types
Using the type attribute on an HTML input field changes the type of input that it accepts. The HTML input has many different input types, which will display the element differently depending on its value. The most common input type value is text, but password radio, and checkbox are also very common.
HTML Input Type Text
Using a value of text for the type attribute on an input field will display a single-line text box for user input. The default width of a text input field is 20 characters, but the width can be manipulated using CSS.
HTML Input Type Password
Using a value of password for the type attribute on an input field will display a single-line text box for users, but when a user types inside the input field, the characters will be replaced with asterisks (*) or dots (•). This is to provide users a secure way to enter their password.
Learn HTML & CSS Today
Get hands-on experience writing real code while you learn with interactive tutorials in our free online learning platform – no downloads or complicated setup required.
- Free and fun
- Designed for beginners
- No download or setup required