Horizontal HTML rules

Using a horizontal rule element (<hr />) helps you include solid straight lines (rules) on your page. The browser creates the rule based on the <hr /> element, so users don’t wait for a graphic to download.                                     A horizontal rule is a good option to ✓ Break a page into logical sections. ✓ Separate headers and footers from the rest of the page. Formatting When you include an <hr /> element on your page, as in the following XHTML, the browser replaces it...

read more

Headings in (X)HTML

Headings break a document into sections. This book uses headings and subheadings to divide each chapter into sections, and you can do the same with your Web page. Headings ✓ Create an organizational structure ✓ Break up the text flow on the page ✓ Provide visual cues as to how pieces of content are grouped HTML includes six elements for different heading levels in documents: ✓ <h1> is the most prominent heading (Heading 1) ✓ <h6> is the least prominent heading (Heading 6) Follow numerical order from lowest to highest as...

read more

Creating Paragraphs in (X)HTML

Paragraphs appear more often than any other text block in Web pages. HTML browsers don’t recognize hard returns that you enter when you create your page inside an editor. You must use a <p> element to tell the browser to package all text up to the closing </p> tag as a paragraph. Formatting To create a paragraph, follow these steps: 1. Add <p> in the body of the document. 2. Type the content of the paragraph. 3. Add </p> to close that paragraph. Here’s what it looks like: <!DOCTYPE html PUBLIC “-//W3C//DTD...

read more

Redirecting users to another page (HTML)

You can use metadata in your header to send messages to Web browsers about how they should display (or otherwise handle) your Web page. Web builders commonly use the <meta /> element this way to redirect page visitors from one page to another automatically. For example, if you’ve ever come across a page that reads This page has moved. Please wait 10 seconds to be automatically sent to the new location. (or something similar), you’ve seen this trick at work. To use the <meta /> element to send messages to the browser, here are...

read more

Formatting WebPages with (X)HTML

We will now describe the markup and document structures that make Web pages workable and attractive. We examine HTML document structure (including document headers and bodies) and show you how to put the pieces together correctly. After that, we talk about organizing text in blocks and...

read more