The <font> Element (deprecated)
You should be aware of the <font> element, which was introduced in HTML 3.2 to allow users more control over how text appears. It was deprecated in HTML 4.0, and has since been removed from XHTML. In its short life, however, it got a lot of use, and if you look at other people’s code you will see itused a lot. If you want to read more about the <font> element, it is covered in Chapter 8. You might see the <font> element used like so: <h3>Using the <font> element</h3>
<font face="arial, verdana, sans-serif" size="2" color="#666666">The <font> element has been deprecated since HTML 4.0. You should now use CSS to indicate how text should be styled. </font>
Understanding Block and Inline Elements
Now that you have seen many of the elements that can be used to mark up text, it is important to make anobservation about all of these elements that live inside the <body> element because each one can fall into
one of two categories:
. Block-level elements
. Inline elements
This is quite a conceptual distinction, but it will have important ramifications for other features of
XHTML (some of which you are about to meet).
Block-level elements appear on the screen as if they have a carriage return or line break before and after
them. For example the <p>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <dl>, <pre>, <hr />,
<blockquote>, and <address> elements are all block level elements. They all start on their own new line, and anything that follows them appears on its own new line, too.
Inline elements, on the other hand, can appear within sentences and do not have to appear on a new line of their own. The <b>, <i>, <u>, <em>, <strong>, <sup>, <sub>, <big>, <small>, <li>, <ins>, <del>, <code>, <cite>, <dfn>, <kbd>, and <var> elements are all inline elements.
For example, look at the following heading and paragraph. These elements start on their own new line and anything that follows them goes on a new line, too. Meanwhile the inline elements in the paragraph
do not require their own new line. Here is the code (ch02_eg20.html):
<h1>Block-Level Elements</h1>
<p><strong>Block-level elements</strong> always start on a new line. The
<code><h1></code> and <code><p></code> elements will not sit
on the same line, whereas the inline elements flow with the rest of the
text.</p>
You should also be aware that in Strict XHTML block-level elements can contain other block-level elements, and inline elements. However, inline elements can appear only within block-level elements, and they may not contain block-level elements (so you should not have a <b> element outside of a block-level element).
© ScienceZen All rights Reserved
1 comments:
Did you know how to change font using google web fonts?
Post a Comment