30.07.2013 Views

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Appendix J Introduction <strong>to</strong> XHTML: Part 1 1403<br />

8 <br />

9 <br />

10 <strong>Visual</strong> <strong>Basic</strong> .<strong>NET</strong> <strong>How</strong> <strong>to</strong> <strong>Program</strong> - Welcome<br />

11 <br />

12<br />

13 <br />

14 Welcome <strong>to</strong> XHTML!<br />

15 <br />

16 <br />

Fig. J.1 First XHTML example (part 2 of 2).<br />

XHTML markup contains text that represents the content of a document and elements<br />

that specify a document’s structure. Some important elements of an XHTML document<br />

include the html element, the head element and the body element. The html element<br />

encloses the head section (represented by the head element) and the body section (represented<br />

by the body element). The head section contains information about the XHTML<br />

document, such as the title of the document. The head section also can contain special document<br />

formatting instructions called style sheets and client-side programs called scripts for<br />

creating dynamic Web pages. The body section contains the page’s content that the browser<br />

displays when the user visits the Web page.<br />

XHTML documents delimit an element with start and end tags. A start tag consists of<br />

the element name in angle brackets (e.g., ). An end tag consists of the element<br />

name preceded by a / in angle brackets (e.g., ). In this example, lines 8 and 16<br />

define the start and end of the html element. Note that the end tag on line 16 has the same<br />

name as the start tag, but is preceded by a / inside the angle brackets. Many start tags define<br />

attributes that provide additional information about an element. Browsers can use this additional<br />

information <strong>to</strong> determine how <strong>to</strong> process the element. Each attribute has a name and<br />

a value separated by an equal sign (=). Line 8 specifies a required attribute (xmlns) and<br />

value (http://www.w3.org/1999/xhtml) for the html element in an XHTML<br />

document. For now, simply copy and paste the html element start tag on line 8 in<strong>to</strong> your<br />

XHTML documents. We discuss the details of the html element’s xmlns attribute in<br />

Chapter 18, Extensible Markup Language (XML).<br />

Common <strong>Program</strong>ming Error J.1<br />

Not enclosing attribute values in either single or double quotes is a syntax error. J.1<br />

Common <strong>Program</strong>ming Error J.2<br />

Using uppercase letters in an XHTML element or attribute name is a syntax error. J.2

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

Saved successfully!

Ooh no, something went wrong!