06.05.2013 Views

Drupal 6 JavaScript and jQuery - Ebook-Cours.com

Drupal 6 JavaScript and jQuery - Ebook-Cours.com

Drupal 6 JavaScript and jQuery - Ebook-Cours.com

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.

[ 11 ]<br />

Chapter 1<br />

HTML<br />

HTML is the primary format for web-based content. As you undoubtedly know,<br />

the purpose of HTML is to "mark up" a text using tags, sometimes with attributes<br />

to provide instructions on how the document is structured <strong>and</strong> how it should look<br />

when displayed in a browser.<br />

Tags <strong>and</strong> elements<br />

An HTML tag looks like this: . Most tags in HTML are paired, with a<br />

start <strong>and</strong> end tag. A tag may also have attributes, such as type="text/<br />

javascript", <strong>and</strong> may also surround some content. When we talk<br />

about the tag, plus the attributes <strong>and</strong> its content, we use the term element.<br />

For example, to indicate that a piece of text is particularly important, we would put it<br />

inside of the tags:<br />

The important thing.<br />

By default, most visual browsers render the content of the element as<br />

bold text as seen here:<br />

The important thing.<br />

HTML's evolution has been a rough one. Initially, it was designed just to provide<br />

structural information about the contents. But somewhere along the line, it also<br />

became a tool for encoding layout <strong>and</strong> styling information. Combining the two<br />

seemingly similar ideas of structure <strong>and</strong> style seemed like a good idea. But in<br />

practice, it made for some very messy code.<br />

The family of HTML specifications can be found online<br />

at http://www.w3.org/html/.<br />

On another front, XML (which we will look at in a moment) evolved separately.<br />

Then, at some point, reconciliation between the HTML st<strong>and</strong>ards <strong>and</strong> the XML<br />

st<strong>and</strong>ards was attempted. The out<strong>com</strong>e of this endeavor was XHTML (HTML in<br />

XML). XHTML is now considered to be the right way to write HTML. In this book, we<br />

will strive to use well-formed XHTML. You may notice this in the following ways:<br />

•<br />

•<br />

All tags <strong>and</strong> attribute names will be in lowercase.<br />

All tags will be closed. That means a tag will either appear in the opening<br />

<strong>and</strong> closing pairs (), or as a single self-closing tag<br />

(—note the forward slash (/) before the closing angle bracket (>)).<br />

• All documents will start with an XML declaration ( ) <strong>and</strong> a<br />

document type declaration ().<br />

This material is copyright <strong>and</strong> is licensed for the sole use by Richard Ostheimer on 18th June 2009<br />

2205 hilda ave., , missoula, , 59801

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

Saved successfully!

Ooh no, something went wrong!