HTML and CSS Reference
In-Depth Information
After the text area, there's just the Submit button for the form. After that, it's all closing
tags for the
<form>
tag,
<body>
tag, and the
<html>
tag. The full source code for the
page follows, along with a screenshot of the form, as shown earlier in Figure 11.16.
Input
▼
<!DOCTYPE html>
<html>
<head>
<title>
Registration Form
</title>
<style type=”text/css” media=”screen”>
form div {
margin-bottom: 1em;
}
div.submit input {
margin-left: 165px;
}
label.field {
display: block;
float: left;
margin-right: 15px;
width: 150px;
text-align: right;
}
label.required {
font-weight: bold;
}
</style>
</head>
<body>
<h1>
Registration Form
</h1>
<p>
Please fill out the form below to register for our site. Fields
with bold labels are required.
</p>
<form action=”/register” method=”post” enctype=”multipart/form-data”>
<div>
<label class=”required field” for=”name”>
Name
</label>
<input name=”name” />
</div>
<div>
<label class=”required field”>
Gender
</label>
<label><input type=”radio” name=”gender” value=”male” />
