HTML Basic Tags
HTML Basic Tags
HTML has six levels of headings: <h1>, <h2>, <h3>, <h4>, <h5>,
and <h6>.
<h1> headings should be used for main headings and has the
largest font-size, followed by <h2> headings, then the less
important headings <h3>, and so on.
While displaying any heading, browser adds one line before and
one line after that heading, and occupies the full screen width.
Heading tags
<!DOCTYPE html>
<html>
<head>
<title>Heading Example</title>
</head>
<body>
<h1>Hello GEHU </h1>
<h2>Hello GEHU </h2>
<h3>Hello GEHU </h3>
<h4>Hello GEHU </h4>
<h5>Hello GEHU </h5>
<h6>Hello GEHU </h6>
</body>
</html>
Example
Each HTML heading has a default size. However, you can specify
the size for any heading with the style attribute, using the CSS
font-size property:
Attributes are written inside the opening tag of the element being
used, as shown below:
<tagname style="property:value;"> Content </tagname>
Bigger Headings
<!DOCTYPE html>
<html>
<body>
<p>You can change the size of a heading with the style attribute, using the
font-size property.</p>
</body>
</html>
Example
Paragraph Tag: The <p> tag offers a way to structure
your text into different paragraphs. Each paragraph
of text should go in between an opening <p> and a
closing </p> tag as shown below in the example:
HTML Paragraphs
<!DOCTYPE html>
<html>
<head>
<title>Paragraph Example</title>
</head>
<body>
<p style="color: blue">Here is a first paragraph of text.</p>
<p>
<h2 style="color: red">Here is the heading of the second paragraph.</h2>
<p style="color: red">Here is the main text of the second paragraph.</p>
</p>
HTML Display
The <pre> tag defines preformatted text.
Text in a <pre> element is displayed in a fixed-width font (usually Courier New), and it preserves
both spaces and line breaks.
Example
<!DOCTYPE html>
<html>
<body>
<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both spaces and
line breaks
</pre>
</body>
</html>
Preserve Formatting
Thank you