NARULA INSTITUTE OF TECHNOLOGY
CA-2
PREPARED BY:
NAME: PRANAY KUMAR GHOSH
STREAM: BCA
SECTION: B
MAKAUT ROLL NUMBER: 30642723058
COLLEGE ROLL NUMBER: 10423074
STREAM: BCA
YEAR: 2023-2024
SUBJECT NAME: BASICS OF WEB DESIGN
USING HTML, CSS, JAVA SCRIPT
SUBJECT CODE: BCAC202
TOPIC: DIFFERENT BASIC TAGS OF HTML
WITH PROPER CODE
HTML - Basic Tags
1. Heading Tags: Any document starts with a heading. You can use
different sizes for your headings.
HTML also has six levels of headings, which use the elements
<h1>,<h2>,<h3>,<h5> and <h6>.While displaying any heading,brow-
ser adds one line before and one line after that heading.
EXAMPLE CODE:
<!DOCTYPE html>
<html>
<head>
<title>Heading Example </title>
</head>
<body>
<h1> This is heading 1</h1>
<h2> This is heading 2</h2>
<h3> This is heading 3</h3>
<h4> This is heading 4</h4>
<h5> This is heading 5</h5>
<h6> This is heading 6</h6>
</body>
</html>
2. Paragraph Tag: The <p> tag offers a way to structure your text
into different paragraphs. Each paragraph of text should go in betwe-
en an opening <p> and a closing </p> tag as shown below in the
example:
EXAMPLE CODE:
<DOCTYPE html>
<html>
<head>
<title> Paragraph Example </title>
</head>
<body>
<p> Here is a rst paragraph of text. </p>
<p> Here is a second paragraph of text. </p>
<p> Here is a third paragraph of text. </p>
</body>
</html>
3. Line Break Tag: Whenever you use the <br /> element, anything
following it starts from the next line. This tag is an example of an
empty element, where you do not need opening and closing tags, as
there is nothing to go in between them.
EXAMPLE CODE:
<!DOCTYPE html>
<html>
<head>
<title> Line Break Example </title>
</head>
<body>
<p> Hello <br />
You delivered your assignment on time.<br />
Thanks<br />
Mahnaz</p>
</body>
</html>
fi
4. Centering Content: You can use <center> tag to put any content
of the page or any table cell.
EXAMPLE CODE:
<!DOCTYPE html>
<html>
<head>
<title> Centering Content Example </title>
</head>
<body>
<p> This text is not in the center. </p>
<center>
<p> This text is in the center. </p>
</center>
</body>
</html>
5. Horizontal Lines: Horizontal lines are used to visual break-up
sections of a document. The <hr> tag creates a line from the current
position in the document to the right margin and breaks the line
accordingly.
EXAMPLE CODE:
<!DOCTYPE html>
<html>
<head>
<title> Horizontal Line Example </title>
</head>
<body>
<p> This is paragraph one and should be on top </p>
<hr />
<p> This is paragraph two and should be at bottom </p>
</body>
</html>
6. Preserve Formatting: Any text between the opening <pre> tag
and the closing </pre> tag will preserve the formatting of the source
document.
EXAMPLE CODE:
<!DOCTYPE html>
<html>
<head>
<title> Preserve Formatting Example </title>
</head>
<body>
<pre>
function testFunction ( strText )
{
alert ( strText )
}
</pre>
</body>
</html>
7. Nonbreaking Spaces: Non-breaking spaces are represented in
HTML using the entity reference. They are used to prevent
the browser from breaking the space between words or elements,
ensuring that speci c content remains together on the same line.
EXAMPLE CODE:
<!DOCTYPE html>
<html>
<head>
<title> Nonbreaking Spaces Example </title>
</head>
fi
<body>
<p> An example of this technique appears in the movie
“12  ; Angry  ; Men.” </p>
</body>
</html>