HOME      |      HTML      |      PHP      |      DREAMWEAVER      |      CSS      |      C      |

HTML Text Formatting Tags

Text Bold

In order to bold a text in Html, the Bold Tag <b> is used.

Example

</html>
<head>
<title> Text Bold Demo </title>
</head>
<body>
Normal
<b> Bold </b>
</body>
</html>

Output

Text Bold Demo

Italic

For making a text or sentence to appear in Italic, the Italic Tag <i> is used.

Example

</html>
<head>
<title> Italic Text Demo </title>
</head>
<body>
Normal
<i> Italic </i>
</body>
</html>


Output

Italics Demo

Style

Text Alignment

To align a text to left, right, center or justify Text-align is used along with style.

Syntax

style=text-align:Text_Position

Example

<html>
<head>
<title> Font Alignment Demo </title>
</head>
<body>
<h1 style=text-align:center> Center </h1>
<h3 style=text-align:left> Left </h3>
<h3 style=text-align:right> Right </h3>
</body>
</html>

Output

Text Alignment Demo

Font Size

To increase or decrease the size of the font, font size is used.

Syntax

style=font-size:size_in_ pixel

Example

<html>
<head>
<title> Font size Demo </title>
</head>
<body>
<p style=font-size:30px> Size - 30px </p>
<p style=font-size:50px> Size - 50px </p>
</body>
</html>

Output

Font Size Demo

Color (Text & Background Color)

To change the colour of the text to make it more appealing, the font-colour is used along with style.

Syntax

For Backgrounf Color,

style=background-color:color_value

For Text Color,

style=color:color_value

Example

<html>
<head>
<title> Back ground and text color Demo </title>
</head>
<body style=background-color:red>
<p style=color:white; font-size:20px;>A paragraph with Text White </p>
</body>
</html>

Output

colour Demo

The Image Tag

The Image Tag <img> is sued to display a image on the webpage. Numerous image formats are supported by web browsers. Jgep, Gig, Tiff, png etc to name a few.

Syntax

<img src=”image name with url” />

Example

<html>
<head>
<title> Image Demo </title>
</head>
<body>
<img src=desk.jpg />
</body>
</html>

Output

Image Demo

Alt Attribute

If your web browser fails to load the Image or Image is loaded slowly because of slow net connection, in such situations, Alt attribute will come in handy, because Alt attribute is used to define an “alternate Text” for the Image. The Alt attribute tells the website visitors, that they are missing an image in the webpage, if the image fails to load.

Syntax

<img src=”image name with url” alt ="Alternate Text" />

 

 

 

WEBSITE TUTORIALS