HTML Formating
From w3cyberlearnings
Contents |
HTML - formatting text
Formatting text within HTML can be accomplised by using the HTML formatting tags.Some of the HTML formatting tags are obsoleted. Additionally, you may want to use the CSS for formatting your HTML page.
HTML - Syntax formatting text
<b> bold text </b> <big> big text </big> <em> emphasized text </em> <i> italic text </i> <small> small text </small> <strong> strong text </strong> <sub> subscripted text </sub> <sup> superscripted text </sup> <ins> inserted text </ins> <del> deleted text </del> <code> computer code text</code> <kbd> keyboard text </kbd> <samp> sample computer code</samp> <tt> teletype text</tt> <var> a variable</var> <pre> preformatted text</pre> <abbr> an abbreviation </abbr> <acronym> an acronym </acronym> <address> contact information </address> <bdo> the text direction </bdo> <blockquote> a long quotation </blockquote> <q> a short quotation </q> <cite> a citation </cite> <dfn> a definition term </dfn>
Note
It is easy to maintain and change the HTML page text or content by using the CSS. CSS is very powerful and it let developer or designer to change the content of the page without changing the page itself.
Formatting Text HTML Tags
Tag | HTML | Description |
---|---|---|
<abbr> | HTML4 | Specifies an abbreviation |
<acronym> | HTML4 | Defines an acronym |
<address> | HTML4 | Specifies an address element |
<address> | HTML4 | Specifies an address element |
<del> | HTML4 | Defines text that has been deleted from a document |
<dfn> | HTML4 | Defines a definition term |
<em> | HTML4 | Specifies emphasized text |
<p> | HTML4 | Defines a paragraph |
<pre> | HTML4 | Defines preformatted text |
<q> | HTML4 | Defines a short quotation |
<samp> | HTML4 | Defines sample output from a computer program |
<small> | HTML4 | Specifies small text |
<strong> | HTML4 | Specifies strong text |
<sub> | HTML4 | Specifies subscripted text |
<sup> | HTML4 | Specifies superscripted text |
Example 1
<!DOCTYPE html> <html> <head> <title>Format</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <h3>Chapter 1</h3> <p><u>Learn how to format your web page:</u><br/> the letter u is used for underline. <b>bolder</b> can be made by the letter b.<br/> If she is more happy, she adds b with u.<br/> Thus, <b><u>U're bolder and underline</u></b>. Nothing to stop here yet.<br/> How about something else? I don't care, but I am part of the letter too. <br/> If you put I in between word, I tell it is different that b or u. <i>Eye</i>.<br/> </p> <h3>Chapter 2</h3> <p> <big>It's big</big>, and when you want something big, you can just say it is big.<br/> big is not a header, it is just big. Don't confuse okay.<br/> </p><address>Send me to my address: 2450 Lake Rd, Apt 4000</address>Address is for address. <dfn>It's just a term</dfn>, by using dfn to tell everyone about the term. </body> </html>
Output TRY-IT
Related Link
- HTML - pre
- HTML - Lists
- HTML - Formatting
- HTML - Fonts
- HTML - Block