HTML and CSS Reference
In-Depth Information
HTML markup uses only the familiar keyboard characters and is enclosed
in angle brackets (<>) . hese characters, especially the let angle bracket, are
reserved for HTML use and must not appear in the content. If a let angle
bracket appears in the content somewhere (for example, as a less-than sign),
the browser parsing your code assumes that it marks the beginning of a new
HTML element. Because browsers are free to ignore any markup they cannot
understand, some of the content following the angle bracket may fail to appear
on the displayed web page.
As a result, HTML has syntax for deining single character entities in the
content. You refer to the character's codename, preceded by an ampersand
(&) and ending with a semicolon (;) . For example, the less-than sign (<) must
be entered as &lt; . he greater-than sign (>) may be entered as &gt; , although
most browsers should recognize it if the context is clear. his scheme requires
the congenial ampersand to be entered in the content using its character entity,
&amp; . Character entities are the method for inserting special symbols such as
quotation marks that are not standardized across languages.
In reading the code in Example 2.1, note that the spacing and indentations
exist only to make the code pretty to read and easier to explain. Web brows-
ers and other user agents are instructed to replace all extraneous white-space
characters with single spaces. his includes tabs, carriage returns, line feeds,
and leading and redundant blanks. All of Example 2.1 could be written on a
single line, and it would still look the same in a browser.
In Example 2.1, notice how the HTML elements appear as paired sets of
start and end tags. he start tag of each pair has a name identifying what kind
of HTML element it is, and the end tag of each pair repeats the name preceded
by a slash (/) . he following HTML elements can be found in Example 2.1:
<html></html> he HTML part of the document
<head></head> Contains information about the document
<title></title> he title that should be assigned to the window
<style></style> Contains CSS rules for formatting document elements
<body></body> he document content and HTML markup
<h1></h1> A level-one heading
<p></p> A paragraph
he HTML elements of Example 2.1 are nested inside one another. he
document is deined by the outer html element, which contains two child ele-
ments: head and body . Every web page must have exactly one head element and
 
Search WWH ::




Custom Search