HTML and CSS Reference
In-Depth Information
his is particularly useful when you need to post some temporary content
quickly and do not want to bother editing the CSS style sheet.
Note:
Netscape introduced a special inline element for text formatting
before its Navigator browser supported CSS. Known as the
font
element,
it takes three attributes:
size
, which is required, and
face
and
color
. The
blink
element was another Netscape innovation. Guess what that does?
Both elements are now deprecated, although they are still supported by
many browsers for backward compatibility. The
blink
element is especially
annoying and almost universally hated.
Two inline HTML elements are especially important. he
anchor
element,
<a></a>
, creates hyperlinks to other pages on the Web, and the
image
element,
<img/>
, inserts images into the content.
To give the links on a page a consistent look, the
anchor
element should
be the innermost nested element. It can contain other inline elements, such
as images, but it should not contain any elements that change the color or
typographic styles of the linked text in a way that suggests that some links are
diferent from others. If a heading is to be hyperlinked to another web page,
the anchor element should be nested inside the heading:
<h3><a href="chapter_5.html">
Chapter 5, Building A Website
</a></
h3>
However, the HTML5 speciication allows the
anchor
element to enclose any
other content as long as that content does not itself contain interactive items—
links or buttons that are sensitive to the actions of mice and ingers.
he
image
element is self-closing. It has two required attributes specifying
the image's source ile and the alternative text to be used if the image itself
cannot be displayed. Here's a typical
image
element:
<img src="logo.png" alt="The Logo Corporation"/>
Although the
alt
attribute is required, it can be let empty for image elements
that are solely decorative. Not every image needs to have a tooltip window pop up
when you hover over it.
<img src="blue_square.gif"
alt=""/>
It is important to remember that images are not block elements. Even
though each image has its own height and width, it is still an inline element,