0% found this document useful (0 votes)
6 views

HTML Guide

A guide for html
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)
6 views

HTML Guide

A guide for html
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/ 2

A Beginners Guide to HTML: Your First Steps into Web Development

What is HTML?
HTML, or Hypertext Markup Language, is the backbone of web pages. Its a language that tells the browser how
to display content on a web page.

Basic Structure of an HTML Document


Every HTML document has a basic structure also called a boiler plate:

HTML
<Html>
<Head>
<Title>My First Web Page</title>
</head>
<Body>
<h1>Hello, World! </h1>
</body>
</html>
Use code with caution.

Lets break down the components:

<html></html>: This tag represents the root of an HTML document.


<head></head>: This section contains metainformation about the page, such as the title.
<title></title>: This tag defines the title of the document, which appears in the browsers title bar.
<body></body>: This section contains the visible content of the page.

Essential HTML Tags


Heading Tags:
<h1> to <h6>: Used to define headings of different levels of importance.
HTML
<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Subsubheading</h3>
Use code with caution.

Paragraph Tag:
<p>: Used to define a paragraph.
HTML
<p>This is a paragraph.</p>
Use code with caution.

Text Formatting Tags:


<b>: Bold text
<i>: Italic text
<u>: Underlined text
<strong>: Important text
<em>: Emphasized text
HTML
<b>Bold Text</b>
<i>Italic Text</i>
<u>Underlined Text</u>
<strong>Important Text</strong>
<em>Emphasized Text</em>
Use code with caution.
Remember:
Always close your tags with a closing slash (/)
HTML Guide: Paragraph, Heading, and Font Tags

1. Paragraph Tag (<p>)

The <p> tag is used to define a paragraph in HTML. It helps structure text by creating space before and after a
block of text, making the content more readable.

Attributes:
align: Sets the alignment of the paragraph. Values include "left", "center", "right", and "justify".

Example:
html
<p align="center">This is a centered paragraph.</p>
<p align="left">This is a left aligned paragraph.</p>
<p>This is a default aligned paragraph, which is usually left aligned.</p>

2. Heading Tags (<h1> to <h6>)

HTML provides six heading tags, <h1> to <h6>, to define headings of different levels. <h1> is the largest and
most important heading, while <h6> is the smallest.

Attributes:
align: Sets the alignment of the heading. Common values are "left", "center", and "right".

Examples:
html
<h1 align="center">This is an H1 heading</h1>
<h2 align="left">This is an H2 heading</h2>
<h3 align="right">This is an H3 heading</h3>
<h4>This is an H4 heading</h4>
<h5>This is an H5 heading</h5>
<h6>This is an H6 heading</h6>

Each heading size represents different levels of importance. <h1> is typically used for main headings, while
<h6> might be used for less important headings.

3. Font Tag (<font>)

The <font> tag is used to change the font, color, and size of text. Although this tag is outdated and not
recommended in HTML5 (CSS is preferred), it is still used in some legacy code.

Attributes:
color: Specifies the color of the font. You can use color names (like "red") or HEX values (like "ff0000").
size: Specifies the size of the font. Values range from 1 to 7, with 1 being the smallest and 7 being the largest.
face: Specifies the font family of the text (like "Arial", "Courier New").
Examples:
html
<font color="blue" size="4" face="Arial">This is blue, size 4, Arial text.</font>
<font color="red" size="5" face="Courier New">This is red, size 5, Courier New text.</font>
<font color="00ff00" size="3">This is green text with default font face.</font>

Summary
<p> tag: Used to create paragraphs, has an align attribute.
<h1> to <h6> tags: Define headings with varying levels of importance, also support align attribute.
<font> tag: Used to change text color, size, and font, though not recommended in HTML5.
For styling in modern HTML, it is best to use CSS rather than the <font> tag.

You might also like