HTML and CSS Reference
In-Depth Information
sets that level-one heading's font the same way as putting the rule in the style
element in the document's head. However, CSS style information in an ele-
ment's start tag overrides previously set rules for the same properties. his is
useful if you do not have access to the document's head in your editor, such as
when editing a blog post. Chapter 3, “Elements of Style,” goes into more detail
on the syntax and use of CSS.
pAr AgrApHS, BLoCk QuoTES, And AddrESS BLoCkS
he paragraph is the most commonly used HTML element for representing
content. he block quote and address block are similar. he blockquote ele-
ment is used to mark up a quotation taken from another source. Block quotes
are usually displayed by the browser with wider let and right margins. he
address element is intended for designating the contact information associated
with a document and is oten rendered in an italic font by browsers. Address
and paragraph elements are not allowed to contain other block elements.
In HTML2, the paragraph element could be used with or without an end
tag. In HTML3 and later versions, the paragraph element is a container, and
it is an error to omit the end tag. Web authors should avoid inserting empty
paragraph elements or break tags into a page just to achieve vertical spacing
of the content elements. If the page design requires more or less space before a
paragraph, the top margin of that paragraph should be increased or decreased.
A blockquote element can contain any other block and inline elements,
but these elements should be related if they are part of the same block quote.
A search engine robot inding a blockquote element can reasonably conclude
that the surrounding content might be related to the quotation and contain
links to sources. It is improper to use a block quote as an alternative paragraph
style, such as in a list of questions and answers. Likewise, an address element
on any web page should be used only for the contact information of the page's
author or the organization responsible for the page's content. Although it is a
common practice, the address element should not be used to mark up postal
addresses in a business directory. Example 2.11 demonstrates the correct use
of these three block elements. Figure 2.11 shows how this HTML appears in
most browsers.
Example 2.11: paragraphs, block quotes, and address blocks in HTML
<!DOCTYPE html>
Search WWH ::

Custom Search