Lesson 3: XHTML Coding Objectives: Demonstrate knowledge of ...
Lesson 3: XHTML Coding Objectives: Demonstrate knowledge of ...
Lesson 3: XHTML Coding Objectives: Demonstrate knowledge of ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Paragraph formatting and block-level elements<br />
There are two types <strong>of</strong> elements:<br />
o A block-level element is an element that affects one or more paragraphs.<br />
o Text-level elements can affect a single character or a word.<br />
There are two types <strong>of</strong> breaks:<br />
o Paragraph breaks – a paragraph break is the most basic block-level<br />
element. The opening and closing paragraph tags define the<br />
beginning and end <strong>of</strong> a paragraph.<br />
o Line breaks – a line break is a text-level element. The line break tag <br />
does not need a separate closing tag.<br />
Heading Levels<br />
There are six Heading levels, h1, h2, h3, h4, h5, and h6.<br />
H1 is the largest heading and H6 is the smallest.<br />
Heading sizes are relative. H4 is the size <strong>of</strong> normal paragraph text.<br />
Heading levels are block elements, so they are automatically preceded and followed<br />
by a paragraph break.<br />
You should not place heading tags between a set <strong>of</strong> paragraph tags.<br />
Tag nesting in markup<br />
Most <strong>of</strong>ten multiple sets <strong>of</strong> tags will be used to format test. To do this you will have<br />
to place one pair <strong>of</strong> tags inside <strong>of</strong> another pair <strong>of</strong> tags, this is called nesting.<br />
Proper nesting requires that open and close one tag within another.<br />
Proper nesting:<br />
o … … <br />
Alignment<br />
Primitive formatting with the tag<br />
o The tag allows you to display plain text files in their original<br />
format.<br />
o This is an easy way to display tabular data<br />
Indenting and Centering<br />
o Text is automatically left aligned in <strong>XHTML</strong>.<br />
o You can center or right align a paragraph using the tag.<br />
This text is centered <br />
o You can also use the align attribute in the paragraph tag to center a<br />
paragraph.<br />
o You can use the tag to indent a paragraph.<br />
Do not use the tag within the tag. Do not use<br />
tags within the tag. Doing either <strong>of</strong> these will<br />
cause your code not to validate.<br />
Text-Level Elements<br />
A text-level element can affect a single character or an entire page.<br />
Basic text-level elements<br />
o Bold tag and strong tag