Để thêm khoảng cách bên trong trường text của form, hãy sử dụng thuộc tính CSS padding.
Ví dụ
Bạn có thể chạy mã sau để đạt được điều này:
<!DOCTYPE html>
<html>
<head>
<style>
input[type="text"] {
width: 100%;
padding: 10px 15px;
margin: 5px 0;
box-sizing: border-box;
}
</style>
</head>
<body>
<p>Điền form bên dưới,</p>
<form>
<label for="subject">Môn học</label>
<input type="text" id="subject" name="sub">
<label for="student">Học sinh</label>
<input type="text" id="student" name="stu">
</form>
</body>
</html>