HTML Text Formatting

Big Example of HTML Code

This is taken from AE, pages 98-99 and placed side-by-side.
 
<HTML>
<HEAD>
  <TITLE> Text Formatting </TITLE>
</HEAD>
<BODY BGCOLOR = "white">
<h1>Doing it Your Way</h1>
<h2>Emphasis</h2>
<p>You can modify text by making it 
<i>italics</i>, <b>bold</b>, 
or <u>underlined</u>.
We can also <em>emphasize</em> 
text or <strong>strongly</strong> 
emphasize it. We can even 
<strong>use these 
<em>in combinations</em></strong>
if we want.</p>
<h2><font color = "red">Paragraphs</font></h2>
<p><center>
We can declare a paragraph <br>
to be center-aligned, 
like this.</center></p>
<p align="right">Or one to be 
aligned to the right margin, 
not much different than what we
do in Word.</p>
<p align="left">Browsers will 
generally put a single blank 
line between paragraphs.
We can insert extra spacing 
with the BR tag.</p>
<br><br>
<hr width="50%">
<p>Above is a <em>horizontal
rule</em>
</BODY>

</HTML>

Doing it Your Way

Emphasis

You can modify text by making it italics, bold, or underlined.   We can also emphasize text or strongly emphasize it.  We can even use these in combinations if we want.

Paragraphs

We can declare a paragraph 
to be center-aligned, like this.
Or one to be aligned to the right margin, not much different than what we do in Word.
Browsers will generally put a single blank line between paragraphs.   We can insert extra spacing with the BR tag.


Above is a horizontal rule.


 
 
 


Summary of Text Tags

Element Function
<B>...</B> Text in boldface
<I>...</I> Text in italics
<U>...</U> Underlined text
<EM>...</EM> Browser determines emphasis (italics)
<STRONG>...</STRONG> Browser determines strong emphasis (boldface)
<CODE>...</CODE> Computer code is displayed without reformatting
<DFN>...</DFN> Text is displayed as a definition
<PRE>...</PRE> Displays the code exactly as formatted, with spaces and blank lines
<BLOCKQUOTE>...</BLOCKQUOTE> Text is displayed as a quotation
<H1>...</H1> Text is displayed as most prominent header
<H2>...</H2> Test is displayed as the next most prominent header
<H3>...</H3>
<H4>...</H4>
<H5>...</H5>
<H6>...</H6>
Four more levels of headers
<CENTER>...</CENTER> The text is centered
<SUB>...</SUB> Text is subscripted
<SUP>...</SUP> Text is superscripted
<BR> Insert a line break
<P> Indicate start of a paragraph
<HR> Insert a horizontal rule
<FONT>...</FONT> Control the font as specified by the attributes.