0% found this document useful (0 votes)
9 views9 pages

HTML Headings and Tags Overview

The document contains code snippets demonstrating various HTML tags for formatting text, inserting lines, grouping elements, and more. It includes tags for headings, paragraphs, horizontal rules, bold, italic, underline, spans, divs, emphasis, small text, deleted text, inserted text, superscript, subscript, strong, line breaks, strikethrough, quotes, addresses, citations, changing text direction, and keyboard input styling.

Uploaded by

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

HTML Headings and Tags Overview

The document contains code snippets demonstrating various HTML tags for formatting text, inserting lines, grouping elements, and more. It includes tags for headings, paragraphs, horizontal rules, bold, italic, underline, spans, divs, emphasis, small text, deleted text, inserted text, superscript, subscript, strong, line breaks, strikethrough, quotes, addresses, citations, changing text direction, and keyboard input styling.

Uploaded by

Ajay Sati
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

HTML Code

First HTML

<!DOCTYPE html>
<html>

<head>
<title>First HTML</title>
</head>

<body>

Simple HTML Code

</body>

</html>

Heading Tag
<!DOCTYPE html>
<html>

<head>
<title>Heading in HTML</title>
</head>

<body>

<h1>Heading1</h1>
<h2>Heading2</h2>
<h3>Heading3</h3>
<h4>Heading4</h4>
<h5>Heading5</h5>
<h6>Heading6</h6>

</body>

</html>

Paragraph Tag
<!DOCTYPE html>
<html>

<head>
<title>Paragraph Tag</title>
</head>

<body>

<p>This is the First Paragraph starting</p>


<p>This is the Second Paragraph starting</p>
<p>This is the Fourth Paragraph starting</p>
<p>This is the Fifth Paragraph starting</p>

</body>

</html>

Horizontal Line
<!DOCTYPE html>
<html>

<head>
<title>Horizontal Line</title>
</head>

<body>

First Line
<hr> Second Line
<hr> Third Line
<hr>

</body>

</html>

Horizontal Line Color

<!DOCTYPE html>
<html>

<head>
<title>Horizontal Line color</title>
</head>

<body>

First Line
<hr color="red"> Second Line
<hr color="green"> Third Line
<hr color="blue">

</body>

</html>

Horizontal Line Size


<!DOCTYPE html>
<html>

<head>
<title>Horizontal Line size</title>
</head>

<body>

First Line
<hr size="10px" color="red"> Second Line
<hr size="30px" color="green"> Third Line
<hr color="blue">

</body>

</html>

Horizontal Line Width


<!DOCTYPE html>
<html>

<head>
<title>Horizontal Line width</title>
</head>

<body>

First Line
<hr width="50%" size="10px" color="red"> Second Line
<hr width="80%" color="green"> Third Line
<hr color="blue">

</body>

</html>

Text Formatting
<!DOCTYPE html>
<html>

<head>
<title>Text Formatting</title>
</head>

<body>

<b>Bold Text</b>
<br>
<i>Italic Text</i>
<br>
<u>UnderLine Text</u>

</body>

</html>

Span Tag
<!DOCTYPE html>
<html>

<head>
<title>span tag</title>
</head>

<body>

<span>This is the sample span</span> Span was end.

</body>

</html>

Div Tag
<!DOCTYPE html>
<html>
<head>
<title>div tag</title>
</head>

<body>

<!--Div can be used to group elements-->


<div>
This is the First Div
<input type="text">
<input type="text">
<input type="text">
</div>

<div>
This is the Second Div
<input type="text">
<button>Sample Button</button>
</div>

</body>

</html>

Emphasized Text
<!DOCTYPE html>
<html>

<head>
<title>Emphasized Text</title>
</head>

<body>

Normal Text<br>
<em>Emphasized Text</em>

</body>

</html>

Small Tag
<!DOCTYPE html>
<html>

<head>
<title>small tag</title>
</head>

<body>

Normal Text<br>
<small>small Text</small>
<br> This is <small>small</small> Sample

</body>

</html>
Mark Tag
<!DOCTYPE html>
<html>

<head>
<title>mark tag</title>
</head>

<body>

Normal Text<br> mark <mark>This</mark> Text

</body>

</html>

Delete Tag
<!DOCTYPE html>
<html>

<head>
<title>mark tag</title>
</head>

<body>

Normal Text<br> mark <mark>This</mark> Text

</body>

</html>

Insert Tag
<!DOCTYPE html>
<html>

<head>
<title>Insert</title>
</head>

<body>

This is the <ins>Inserted Text</ins>

</body>

</html>

Subscripted Tag
<!DOCTYPE html>
<html>

<head>
<title>subscripted Text</title>
</head>

<body>
This is the <sub>subscripted</sub> Text

</body>

</html>

Superscripted Tag
<!DOCTYPE html>
<html>

<head>
<title>superscripted Text</title>
</head>

<body>

This is the <sup>superscripted</sup> Text

</body>

</html>

Strong Tag
<!DOCTYPE html>
<html>

<head>
<title>Strong tag</title>
</head>

<body>

This is the <strong>Strong Text</strong>

</body>

</html>

BR Tag
<!DOCTYPE html>
<html>

<head>
<title>BR Tag</title>
</head>

<body>

<!--Without BR Tag-->
Line 1
Line 2
Line 3
Line 4
Line 5

<!--With using BR Tag-->


<br> Line 1
<br> Line 2
<br> Line 3
<br> Line 4
<br> Line 5

</body>

</html>

S Tag
<!DOCTYPE html>
<html>

<head>
<title>s tag</title>
</head>

<body>

<s>This is the</s> HTML Code Play

</body>

</html>

Q Tag
<!DOCTYPE html>
<html>

<head>
<title>Quotation</title>
</head>

<body>

He said <q>This is too much.</q>

</body>

</html>

Address Tag

<!DOCTYPE html>
<html>

<head>
<title>Address</title>
</head>

<body>

My Address is.
<Address>
Ramesh,<br>
Kozicode,<br>
Chennai,<br>
Pin-629167,<br>
[Link].
</Address>

</body>

</html>

Cite Tag
<!DOCTYPE html>
<html>

<head>
<title>cite</title>
</head>

<body>

This article is written by Merbin Joe and from <cite>Mulagumoodu</cite>.

</body>

</html>

BDO Tag
<!DOCTYPE html>
<html>

<head>
<title>bdo</title>
</head>

<body>

This is normal text


<br>
<bdo dir="rtl">Right to Left Direction</bdo>

</body>

</html>

KDB Tag
<!DOCTYPE html>
<html>

<head>
<title>kdb</title>
</head>

<body>

kbd define keyboard input


<br>
<kbd>This text style different</kbd>

</body>

</html>

Common questions

Powered by AI

In HTML, the 'ins' and 'del' tags are used to indicate modifications in a document. The 'ins' tag stands for 'inserted text' and is used to show additions to a document, often rendered with an underline . Conversely, the 'del' tag represents 'deleted text', typically shown with a strikethrough . These tags help in tracking changes, making it clear what content has been added or removed, which is especially useful for document versions or collaborative editing.

The 'bdo' tag in HTML is significant for controlling text directionality. It stands for 'bidirectional override,' allowing developers to explicitly set the text direction of its content. For example, using the attribute 'dir="rtl"' (right-to-left) can make text display from right to left, which is valuable for languages such as Arabic or Hebrew . This tag ensures that text adheres to the correct reading order, which is essential for readability and proper presentation in multilingual documents.

The 'div' tag in HTML is important for organizing content because it acts as a container to group elements together. This allows for more structured and manageable HTML documents, particularly useful in conjunction with CSS for styling and JavaScript for scripting. The 'div' tag does not inherently provide any styling or functionality but offers a way to apply styles to multiple elements at once or to control their layout . Additionally, 'div' can contain block-level content and is essential for creating complex page layouts.

The 's' tag in HTML impacts the visual appearance of text by rendering it with a strikethrough. This styling can indicate that text is no longer relevant or has been updated while still showing the original content. Historically, the 's' tag was often used to denote typographical errors or changes in print, and its use in HTML reflects its print past for indicating obsolete or less important text . Although less commonly used today, it still appears in contexts where showing the original and edited states of content is necessary.

In HTML, the 'br' tag and 'p' tag serve different purposes for managing text layout. The 'br' tag inserts a line break in the text without adding paragraph separation, often used for controlling precise line breaks within a block of text, such as addresses or poems . Conversely, the 'p' tag is used to define a paragraph, marking a block-level element that adds space before and after the text within it, thus creating a clear separation between blocks of content . Efficient use of these tags enables better control of document layout and readability.

In HTML, the 'hr' tag can be styled by specifying attributes such as color, size, and width. When the color attribute is set (e.g., 'hr color="red"'), the horizontal line is colored accordingly . Similarly, the size attribute sets the thickness of the line, for instance, 'hr size="10px"' results in a thicker line . The width attribute determines how much of the page width the line will cover, such as 'hr width="50%"', which makes the line span half the width of its container . These styling options allow for greater customization of horizontal lines in web pages.

The 'strong' and 'em' tags in HTML are used to alter emphasis and meaning, affecting both the presentation and semantic understanding of text. The 'strong' tag is intended to denote strong importance, often displayed as bold text by default, signaling to users and search engines that this portion of text is crucial . The 'em' tag, on the other hand, indicates emphasis with a change in intonation, usually rendered as italic text, highlighting that this content should be stressed . Both tags provide semantic meaning, which is beneficial for accessibility and interpreting the content's intent, reinforcing the importance of specific text to screen readers and search engines.

The 'span' tag is preferred over the 'div' tag in scenarios where inline grouping of content is needed. Unlike 'div', which is a block-level element, 'span' is an inline element, meaning it does not disrupt the flow of text. It is useful for applying styles to part of a text within a paragraph or any inline content without affecting the surrounding elements . 'Span' is ideal when you need to style a specific part of an inline content without block-level separation.

The 'kbd' tag in HTML is utilized to denote keyboard input. This tag is often used in technical documents or instructions, where it is important to show what users must type. For example, the 'kbd' tag can be used to display keyboard shortcuts or commands, as in 'Press <kbd>Ctrl+C</kbd> to copy' . It generally appears styled differently (often in a monospaced or 'typewriter' font), highlighting that the enclosed text represents exact input from a keyboard or similar input method.

Semantic HTML tags like 'address', 'cite', and 'q' play a crucial role in enhancing both accessibility and SEO. These tags provide clear meaning to the web content, which assists search engines in understanding the context and improves indexing efficiency . Additionally, semantic tags improve accessibility by giving screen readers and other assistive technologies more information about the structure and function of the content, thus enhancing the web experience for users with disabilities. The 'address' tag denotes contact information, 'cite' is used for referencing a creative work, and 'q' marks inline quotations, all contributing to a more meaningful and structured document that is understandable to both machines and humans.

You might also like