Saturday 4 April 2015

HTML Text Formatting

HTML has different tags for different purpose. One such purpose is formatting text. In HTML, we can give headings, give styles to text and so on. It is thee function ehich make HTML easy to handle.

HTML Headings

Headings are important in HTML. Heading are given to mark the beginning or to know what the content is about.

Headings are defined using <h1> to <h6> tags. <h1> tag describe the most important heading and is the biggest heading of all. <h6> tag describes the least important heading and is the smallest of all.

Attributes
align left
center
right
justify
Specifies the alignment of a heading

For example:
<h1>This is a heading.</h1>
<h2>This is a heading.</h2>
<h3>This is a heading.</h3>
<h4>This is a heading.</h4>
<h5>This is a heading.</h5>
<h6>This is a heading.</h6>

HTML Paragraphs

Paragraphs are used to separate the content to separate sections. The paragraphs are defined using <p> tag.

Attributes
align left
center
right
justify
Specifies the alignment of the text within a paragraph

For example:
<p>This is a paragraph</p>
<p>This is another paragraph</p>

HTML Line Breaks

Line Break is the same function as Enter key in Microsoft Word. It is used to break the line and to start the continuous sentence in the next line. The line break is defined using the <br> tag. Note that <br> is an empty tag, so it does not contain a closing tag.

For example:
This is a sentence <br> with line breaks.

HTML Formatting Tags

HTML language uses text formatting tags to style HTML contents. These tags are used to edit the pages of the HTML document.

Text Formatting Tags
Text formatting tags are commonly used for editing text. The text formatting tags are:
Bold (<b> and </b>) Defines bold text
Emphasized (<em> and </em>) Defines emphasized text
Italics (<i> and </i>) Defines italics text
Small (<small> and </small>) Defines small text
Strong (<strong> and </strong>) Defines strong text
Subscript (<sub> and </sub>) Defines subscripted text
Superscript (<sup> and </sup>) Defines superscripted text
Underline (<u> and </u>) Defines underlined text
Strike-Through (<s> and </s>) Defines striked text
Insert (<ins> and </ins>) Defines inserted text
Delete (<del> and </del>) Defines deleted text
Word Break Opportunity (<wbr>) Defines where it is ok to add a line break in the text
Marked (<mark> and </mark>) Defines marked/highlighted text

For example:
<b>This text is bold.</b>
<em>This text is emphasized.</em>
<i>This text is italics.</i>
<small>This text is small.</small>
<strong>This text is strong.</strong>
This text is <sub>subscript</sub> and this text is <sup>superscript.</sup>
This text is <u>underlined.</u>
This text is <s>striked</s>
This text is <ins>inserted</ins> and this text is <del>deleted.</del>
This text has <wbr>line break<wbr> here.
This text is <mark>marked.</mark>

Computer Output Tags
Computer output tags are used to write data in a computer coded manner. It is useful in writing codes and programs. The computer output tags are:
Computer Code (<code> and </code>) Defines computer code text
Keyboard Input (<kbd> and </kbd>) Defines keyboard text
Sample Computer Code (<samp> and </samp>) Defines sample computer code
Variable (<var> and </var>) Defines a variable
Preformatted Text (<pre> and </pre>) Defines preformatted text

For example:
<code>This is a computer coded text.</code>
<kbd>This is keyboard text.</kbd>
<samp>This is a sample computer coded text.</samp>
<var>This is a variable.</var>
<pre>This is a
preformatted   text</pre>

HTML Citations, Quotation and Definition Tags
These tags are used to give information regarding the page and also giving an inline quotation and so on.
Abbreviation (<abbr> and </abbr>) Defines a abbreviation or acronym.
Address (<address> and </address>) Defines contact information for the owner/author of the document.
Bi-Directional Override (<bdo> and </bdo>) Defines the direction of the text.
Blockquote (<blockquote> and </blockquote>) Defines a section that is quoted from other source.
Quotation (<q> and </q>) Defines a short inline quotation.
Citation (<cite> and </cite>) Defines the title of the work.
Definition (<dfn> and </dfn>) Defines a definition term.

For example:
I want it <abbr title="As Soon As Possible">ASAP.</abbr>
<address>
Written by WebLearn Tech
Address: Asokapuram, Aluva
Phone: +91 9746187942
</address>
<bdo dir="rtl">
This sentence is written from right to left.
</bdo>
<blockquote cite="http://en.wikipedia.org/wiki/HTML">HTML or Hyper Text 
 Markup language is the standard markup language used to create webpages.
 </blockquote>
<q>Every moment in our life is precious for us all.</q>
<cite>WWW</cite> was invented by Tim Berners Lee.
<dfn>Definition term</dfn>

HTML Lines

HTML lines are created to separate each content with a line. The <hr> tag is used for this purpose.

Attributes
align left
center
right
Specifies the alignment of a <hr> element
noshade noshade Specifies that a <hr> element should render in one solid color (noshaded),
instead of a shaded color
size pixels Specifies the height of a <hr> element
width pixels
%
Specifies the width of a <hr> element

For example:
<p>This is a paragraph</p>
<hr>
<p>This is another paragraph</p>
<hr>

0 comments:

Post a Comment