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

HTML

HTML

Uploaded by

ayaankim007
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)
7 views

HTML

HTML

Uploaded by

ayaankim007
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

Basics of HTML

HTML stands for HyperText Markup Language. It is the language used to


create web pages. HTML uses tags to define the structure and content of a
web page.

The basic structure of an HTML document is as follows:

<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>This is my first web page!</h1>
</body>
</html>

The <!DOCTYPE html> tag tells the web browser which version of HTML to
use. The <html> tag defines the beginning of the HTML document. The
<head> tag defines the head of the HTML document, which contains
information about the document, such as the title. The <body> tag defines the
body of the HTML document, which contains the actual content of the page.

The <h1> tag is a heading tag that is used to create a heading. The This is
my first web page! text is the content of the heading.

There are many other tags that can be used in HTML. For a complete list of
HTML tags, you can refer to the W3Schools HTML reference:
https://www.w3schools.com/tags/.

HTML comments

HTML comments are used to provide information about the HTML document
that is not visible to the user. Comments are enclosed in <!-- and --> tags.

For example, the following comment would provide information about the
author of the HTML document:

<!-- This document was created by Bard -->


Formatting and fonts

HTML can be used to format text and set fonts. The <p> tag is used to create
a paragraph. The <b> tag is used to make text bold. The <i> tag is used to
make text italic. The <font> tag is used to set the font of the text.

For example, the following code would create a paragraph of bold, italic text in
the Arial font:

<p><b><i>This is some bold, italic text in Arial font.</i></b></p>

Color

HTML can be used to set the color of text and backgrounds. The <font
color="color_code"> tag is used to set the color of the text. The <body
bgcolor="color_code"> tag is used to set the color of the background.

The color_code can be a hexadecimal color code, a CSS color name, or an


RGB value. For example, the following code would set the color of the text to
red and the background to blue:

<font color="#FF0000">This text is red.</font>


<body bgcolor="#0000FF">This background is blue.</body>

Hyperlink

A hyperlink is a link to another web page or document. Hyperlinks are created


using the <a> tag. The <a href="url"> attribute specifies the URL of the
linked document.

For example, the following code would create a hyperlink to the Google
homepage:

<a href="https://www.google.com">Google</a>

Lists

HTML can be used to create lists of items. There are three types of lists:
ordered lists, unordered lists, and definition lists.
Ordered lists are lists of items that are numbered sequentially. The <ol> tag is
used to create an ordered list. The <li> tag is used to create an item in the
list.

For example, the following code would create an ordered list of the days of
the week:

<ol>
<li>Sunday</li>
<li>Monday</li>
<li>Tuesday</li>
<li>Wednesday</li>
<li>Thursday</li>
<li>Friday</li>
<li>Saturday</li>
</ol>

Unordered lists are lists of items that are not numbered. The <ul> tag is used
to create an unordered list. The <li> tag is used to create an item in the list.

For example, the following code would create an unordered list of the colors
of the rainbow:

<ul>
<li>Red</li>
<li>Orange</li>
<li>Yellow</li>
<li>Green</```

You might also like