HTML Text Formatiing

 

HTML Tags:

An HTML document consist of its basic building blocks which are:

Tags: An HTML tag surrounds the content and apply meaning to it. It is written between < and > brackets.

Attribute: An attribute in HTML provides extra information about the element, and it is applied within the start tag. An HTML attribute contains two fields: name & value.

Syntax

<tag name  attribute_name= " attr_value"> content </ tag name>

Elements: An HTML element is an individual component of an HTML file. In an HTML file, everything written within tags are termed as HTML elements.


Text formatting:

HTML contains several elements for defining text with a special meaning.

Formatting elements were designed to display special types of text:

·         <b> - Bold text

Ex: <b>This text is bold</b>

·         <strong> - Important, text

 Ex: <strong>This text is important!</strong>

·         <i> - Italic text

Ex: <i>This text is italic</i>

·         <em> - Emphasized text

Ex: <em>This text is emphasized</em>

·         <mark> - Marked/Highlighted text,

   Ex: <p>Hardwork is <mark>Key</mark> to Succes.</p>

·         <small> - Smaller text

Ex: <small>This is some smaller text.</small>

·         <del> - Deleted text in document(usually striked)

Ex: <p>My favorite color is <del>blue</del> red.</p>

·         <ins> - Inserted text(usually underlined)

Ex: <p>My favorite color is <del>blue</del> <ins>red</ins>.</p>

·         <sub> - Subscript text

Ex: <p>This is <sub>subscripted</sub> text.</p>

·         <sup> - Superscript text

Ex: <p>This is <sup>superscripted</sup> text.</p>

Comment Tags: Comments are not displayed by the browser, but they can help document your HTML source code. We can add comments to your HTML source by using the following syntax:

<!-- Write your comments here -->

With comments you can place notifications and reminders in your HTML code:

Example

<!-- This is a comment -->

<p>This is a paragraph.</p>

<!-- Remember to add more information here -->

Comments are also great for debugging HTML, because you can comment out HTML lines of code, one at a time, to search for errors:

Example

<!-- Do not display this image at the moment
<img border="0" src="pic_trulli.jpg" alt="Trulli">
-->

Comments

Popular posts from this blog

DBMS - Program 6 - Insurance Database

Types of Addressing modes

Java - Swing