- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Add space inside a form’s text field with CSS
To add space inside a form’s text field, use the CSS padding property.
You can try to run the following code to achieve this:
Example
<!DOCTYPE html> <html> <head> <style> input[type = text] { width: 100%; padding: 10px 15px; margin: 5px 0; box-sizing: border-box; } </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 Articles
- Work with white-space inside an element with CSS
- Add space between pagination links with CSS
- Add a caption text inside a thumbnail class
- Add shadow effects to text with CSS
- How to add text inside a Tkinter Canvas?
- Add or subtract space between the words of a sentence with CSS
- Add more than one shadow to a text with CSS
- Add the slug field inside Django Model
- How to add text inside a plot in Matplotlib?
- Add or subtract space between the letters that make up a word with CSS
- How to add a text editor field in Django?
- Disable text wrapping inside an element using CSS
- How to add space between characters in Text using FabricJS?
- Set the text shadow around a text with CSS
- Underline text with CSS

Advertisements