Html Logical Styles of text

The logical styles of text are used to add a specific destination to a specific block of text.

<blockquote> or <q>Quotations elements
<hr>Horizontal rules
<center>The center element
<div> & <span>Grouping Elements
<pre>Pre-formatted text blocks
<em>,<strong>,<dfn>, <code>,<samp>,<acronym>, <var>,<cite>,<abbr>,<kbd>Phrase Elements
<p> Paragraphs

The <p> tag defines a paragraph. Using this tag, we can split long text. A blank line above and below the text of the paragraph.

<p align="center">..</p>
- The <p> element can have an attribute called align, which is used to define the the alignment for the text of the paragraph. - The align attribute can have the values "left", "center", "right" or "justify". The default value is "left"
<h1><h2>..<h6> Headings

HTML allows you to add headings into a web page. Headings may look different on each browser.

There are six headings tag.
<h3 align="left">Heading3</h3>
-All headings should have the ending tag -All headings are rendered on a new line leaving an extra space after the previous block. -The align attribute can have the values "left", "center", "right" or "justify". The default value is "left"
<blockquote> Element

The <blockquote>..</blockquote> element is designed for inserting quotations into a web page.

The block-quote element adds extra white spaces before and after the element and on the left and on the right of the element.

<q> element

The <q>..</q> element is designed for in-line quotation. While rendering, the element does'nt start on the new line.

<hr> Horizontal Rules element

The HTML <hr> tag is used for creating a horizontal line. This is also called Horizontal Rule in HTML which makes distinction between different sections of a web page.

<hr align="center" width="50%" size="5" noshade color="red">
align"left" | " center" | "right"
widthA positive integer (or) a positive integer between 1 and 100 followed by %; default is "100%"
sizeThe thickness of the rule in pixel; the default is 2
noshade If present, the rule is flat rule. else a 3D rule with a shadow.
colorThe default color is "black".
*A horizontal rule tag <hr> does'nt require an ending tag. *A horizontal rule can have more than one attributes.
<center> element

The center element is used to center content (e.g. text, images, horizontal rules)

    Normal horizontal rule
    <hr width="90%">

    center aligned horizontal rule    
        <hr width="50%">
Normal horizontal rule
center aligned horizontal rule

<div> element

There are two kind of elements in HTML.

Element TypesDescription
Block level elementsRendered starting on a new line (e.g. <p> or <hr>)
In-line elementsRendered on same line (e.g. <b> or <q>)

The HTML <div> element is the most generic block-level element. This tag is used for defining a section of your document and also we can group large sections of HTML elements together. This element is best to attach a CSS to a section of a web page.

<div align="center" title="This is a tooltip">
This is a division block.
<span> element

The HTML <div> element is the most generic in-line element. This element is best to attach a CSS to a section of a web page.

The difference between the <div> tag and the <span> tag is that the <div> tag is used with block-level elements while the <span> tag is used with in-line elements.

The <span> tag has all the properties of the <div> tag except the align attribute as it is an in-line element.

<span align="center" title=">
The best Quote website.
<pre> element

The HTML <pre> Element (or HTML Preformatted Text) represents preformatted text. Text within this element is typically displayed exactly as it is laid out in the file. Whitespaces inside this element are displayed as typed.

The inserted HTML tags into a block of text will not be interpreted by the browser. Use &lt; for the < character and &gt; for the > character.

Phrase element

The phrase elements allow you to add a specific meaning to a section of the document. These phrase are rendered differently in different browsers.

<em>..</em>Rendered in the italic text style
<strong>..<strong>Rendered in the bold text style.
<dfn>..</dfn>To emphasize the first appearance of a concept.
<code>..</code>To insert a fragment of computer program code; rendered in the monospace font style.
<samp>..</samp>To insert the output of an application; rendered in the monospace font style.
<kbd>..</kbd>To insert a computer command that the user should type; rendered in the monospace font style.
<var>.. </var>To insert variables of a computer program; renderd in the italic font style.
<cite>..</cite>To insert a reference to its source document; renderd in the italic text style.
Related Tutorial
1 Html
5 Lists
6 Images
7 Links
11 Frames
13 tables
Follow Us #