11.11.2014 Views

Professional Web Design: Techniques and Templates, Fourth Edition

Professional Web Design: Techniques and Templates, Fourth Edition

Professional Web Design: Techniques and Templates, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

378<br />

Chapter 14 ■ Case Study: A CSS Form<br />

■<br />

■<br />

The tag is styled by the a5-row-1 label rule in the style sheet. This<br />

rule assigns a width of 220 pixels to the tag, floating it to the left of the form<br />

field, aligning its text to the right, <strong>and</strong> creating 30 pixels of padding to the<br />

right.<br />

A tag, with the class a5-required-field assigned to it, is wrapped<br />

around an asterisk. The sole purpose of this style is to make the asterisk red<br />

to help it st<strong>and</strong> out visually.<br />

Much of what is discussed with this example row is reused for many of the items<br />

in the form. Listing 14.3 shows the text that is added.<br />

Listing 14.3<br />

XHTML Code for First Name Row<br />

<br />

First Name: *<br />

<br />

<br />

Adding the Last Name Row<br />

The Last Name row uses much of the same code as the First Name line. The main<br />

difference is that this row is added to provide an example of a disabled row.<br />

Figure 14.6 shows how the disabled version appears when the a5-disabled-field<br />

class is added to the code in Listing 14.4. It is important to note that if the class<br />

were not added to the form field, it would still be disabled but it would appear<br />

nearly the same as the First Name field. This is why the a5-disabled-field rule<br />

has a background color added to it.<br />

Figure 14.6<br />

The form with the Last Name row added.<br />

Game Developing GWX

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!