

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Style Input Fields of a form with CSS
To style the input field of a form, you can try to run the following code. Style the <input>:
Example
<!DOCTYPE html> <html> <head> <style> input { width: 100%; } </style> </head> <body> <p>Fill the below form,</p> <form> <label for = "subject">Subject</label> <input type = "text" id = "subject" name = "sub"> <label for = "student">Student</label> <input type = "text" id = "student" name = "stu"> </form> </body> </html>
- Related Questions & Answers
- Some Lesser-Known CSS Properties for Form Input Fields
- Style input type reset with CSS
- Style input type submit with CSS
- Style input type button with CSS
- How to add form validation for empty input fields with JavaScript?
- Add a background color to the form input with CSS
- Style all <input> elements with a valid value with CSS
- Style every checked <input> element with CSS
- Style every disabled <input> element with CSS
- Style every enabled <input> element with CSS
- Style <input> elements with a "readonly" attribute with CSS
- Style <input> elements with a "required" attribute with CSS
- Style <input> elements with a value within a specified range with CSS
- Style <input> elements with a value outside a specified range with CSS
- Style all <input> elements with an invalid value with CSS
Advertisements