HTML and CSS Reference
In-Depth Information
<br />
</fieldset>
<label>Card number
<input id="card_number" name="card_number" type="text" />
</label>
<label>Expiration date
<input id="expiration" name="expiration" type="text" />
</label>
<br />
<input class="submit" type="submit" value="Submit" />
<br />
</fieldset>
</form>
</body>
</html>
Applying Basic Styling to the Form
To start with, let's apply some basic, simple styles to the form. First, we'll set the form to be 75
percent wide and to be centered horizontally with a 3em vertical margin:
form {
margin: 3em auto;
width: 75%;
}
We'll also shape up our fieldset elements a bit, giving them a background color, a border,
and some margin and padding:
fieldset {
background-color: #dfdfdf;
border: 1px solid #ccc;
margin: 2em 0;
padding: 1em;
}
Search WWH ::




Custom Search