0% found this document useful (0 votes)
5 views3 pages

Garv

The document provides an HTML code example demonstrating various text formatting tags such as bold, italics, underline, superscript, subscript, and deleted text. It includes CSS styles for text alignment and font customization. The code is structured with a header and main content area showcasing different text styles.

Uploaded by

priyansh Chhabra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Garv

The document provides an HTML code example demonstrating various text formatting tags such as bold, italics, underline, superscript, subscript, and deleted text. It includes CSS styles for text alignment and font customization. The code is structured with a header and main content area showcasing different text styles.

Uploaded by

priyansh Chhabra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

Write the code in HTML using text formatting tags like font, font colour, font type,
bold, italics, superscript, subscript, underline, strong, align, deleted text etc. . Write the
code in HTML using text formatting tags like font, font colour, font type, bold, italics,
superscript, subscript, underline, strong, align, deleted text etc.

CODE :

<!DOCTYPE html>
<html>
<head>
<title>By Garv Gaba</title>
<style>

body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
line-height: 1.6;
background-color: #f5f5f5;
color: #333;
}
header {
background-color: blue;
color: white;
padding: 20px;
text-align: center;
}
main {
padding: 20px;
}
p{
margin-bottom: 10px;
}
.bold {
font-weight: bold;
}
.italic {
font-style: italic;
}
.underline {
text-decoration: underline;
}
.strong {
font-weight: bold;
}
.sup {
vertical-align: super;
font-size: smaller;

1
}
.sub {
vertical-align: sub;
font-size: smaller;
}
.deleted {
text-decoration: line-through;
color: #d9534f;
}
.styled-text {
color: #007bff;
font-family: 'Courier New', Courier, monospace;
font-size: 1.2em;
}
.center {
text-align: center;
}
.right {
text-align: right;
}
.left {
text-align: left;
}
</style>
</head>
<body>

<header>
<h1>By Garv Gaba</h1>
</header>

<main>
<p class="bold">This is a <span class="strong">strong</span> text example.</p>

<p class="italic">This is an <span class="italic">italic</span> text example.</p>

<p class="underline">This is an <span class="underline">underlined</span> text example.</p>

<p>This is an example of <span class="sup">superscript</span> and <span class="sub">subscript</span>


text.</p>

<p>This is <span class="deleted">deleted</span> text.</p>

<p class="styled-text">This is text with a different style: color, font family, and size.</p>

<p class="center">This text is aligned to the center.</p>


<p class="right">This text is aligned to the right.</p>
<p class="left">This text is aligned to the left.</p>

2
</main>

</body>
</html>

OUTPUT :

You might also like