23.05.2015 Views

Building the User Interface by Using HTML5: Organization ... - server

Building the User Interface by Using HTML5: Organization ... - server

Building the User Interface by Using HTML5: Organization ... - server

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.

54 | Lesson 3<br />

■ Choosing and Configuring <strong>HTML5</strong> Tags to Organize Content and Forms<br />

THE BOTTOM LINE<br />

<strong>HTML5</strong> introduces several new elements for organizing content and forms. They represent<br />

<strong>the</strong> new semantic markup that’s an important part of <strong>HTML5</strong>.<br />

LICENSED PRODUCT NOT FOR RESALE<br />

<strong>HTML5</strong> markup introduces many new markup tags for organizing <strong>the</strong> structure of HTML<br />

documents, which makes documents easier to create and modify. The new tags have more<br />

intuitive names than similar constructs in previous HTML specifications; <strong>the</strong> tags are named<br />

more appropriately for <strong>the</strong> part of <strong>the</strong> page <strong>the</strong>y apply to, such as , ,<br />

and .<br />

<strong>HTML5</strong> has also streamlined table creation, moving many of <strong>the</strong> table attributes that affect<br />

width, cell padding, and vertical and horizontal alignment to <strong>the</strong> CSS file.<br />

Understanding Semantic HTML<br />

Semantic markup uses tag names that are intuitive, making it easier to build and modify<br />

HTML documents, and for Web browsers and o<strong>the</strong>r programs to interpret.<br />

CERTIFICATION READY<br />

What is semantic<br />

markup?<br />

2.4<br />

One of <strong>the</strong> very handy new features of <strong>HTML5</strong> is <strong>the</strong> use of semantic markup, which gives<br />

better meaning, or definition, to several tags so <strong>the</strong>y make more sense to humans, programs,<br />

and Web browsers. As mentioned in Lesson 2, not all HTML tags have been replaced or<br />

updated for <strong>HTML5</strong>, but some new tags introduced in <strong>HTML5</strong> make <strong>the</strong> work of creating<br />

Web pages a lot easier.<br />

In HTML 4.01 and prior specifications, a developer creating <strong>the</strong> structure of an HTML<br />

document uses <strong>the</strong> tag frequently throughout. The tag often includes a class or<br />

ID attribute, which may also include CSS styles such as background-color, height, and<br />

width. A simple example of a tag is:<br />

This is a header <br />

TAKE NOTE<br />

*<br />

class and id are global attributes, which means <strong>the</strong>y can be used with any HTML<br />

element. You can see <strong>the</strong> complete list of global HTML attributes at http://dev.w3.org/<br />

html5/markup/global-attributes.html.<br />

The div element alone doesn’t have much meaning without <strong>the</strong> id or class attribute. Even<br />

<strong>the</strong> ID can be assigned a value of your choice, such as "header", "header_inner", "slogan",<br />

"content", "style", and many more. An example from an HTML 4.01 document<br />

is shown as follows:<br />

<br />

<br />

<br />

Happy dogs are good dogs<br />

<br />

<br />

<strong>HTML5</strong> uses simpler tags to replace many of <strong>the</strong> div tags, some of which are shown in<br />

Figure 3-1.

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

Saved successfully!

Ooh no, something went wrong!