04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Test driving a very tabular form<br />

Open “styledform.html” in your browser and take a look at the Starbuzz<br />

Bean Machine form in table format. It looks better, doesn’t it? All the labels<br />

and form elements are aligned, and it looks more professional.<br />

Now, we can use <strong>CSS</strong> to make it look even better, by tweaking some things<br />

here and there. Let’s take a look at what you might want to change.<br />

We can align all these<br />

labels to the right<br />

so they line up nicely<br />

against the form<br />

elements.<br />

We can also align the<br />

labels and the form<br />

elements vertically<br />

so they both align<br />

to the top of the<br />

data cells.<br />

Finally, we’ll add just<br />

a bit of space on the<br />

left side of the body.<br />

We’ll do some basic styling that you’re well<br />

familiar <strong>with</strong> by now, like changing the<br />

font, and adding a background color.<br />

xhtml forms<br />

A border around the<br />

table would look nice.<br />

Notice how<br />

the rows are a<br />

little too close<br />

together? We<br />

can add space<br />

between the cells<br />

in the rows so<br />

the form is easier<br />

to read.<br />

you are here 629

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

Saved successfully!

Ooh no, something went wrong!