Lecture-2 : COMMON TAGS

In HTML formatting is specified by using Tags. A Tag is a format name surrounded by angle brackets. End tags which a format off also contain forward slash

Example
<h1>My First Heading</h1>

where <h1> is the opening tag and </h1> is a closing tag

There are two type of tags in html namely:
1. Container Tags: HTML tags that need to be closed with </> command is called container tag. For example <B> and </B> is a container tag and also described as a nested tag.
2. Empty Tags: the tags that don't need to be closed with </> command is called an empty tag. For example <br>, <hr> are the empty tags they don't need to be closed with </ > command.

White spaces, tabs and new lines are ignored by the browsers. For this there are some tags is HTML, now let us study them

Basic Tags in HTML



<HTML>:- The tag is used to tell the browser that everything contained between them is a HTML code. <HTML> is the start of the web page and </HTML> is the end of the Web page

<HEAD>:- This tag holds the information about the document, such as the page title. The tags that can appear only in the <head> section are <title>, <link>, <meta>

<TITLE>:- The tag gives the title of the title of the web page. This title appears in the web browser's title bar and is used by the search engines to refer the document. <title>MyInstitution </title>

<BODY>:- This tag contains the body of the HTML document, which includes creating web pages contents like text, images, links, forms, etc

Comment Tag:- <!-- -->This tag is used to write comments in the HTML source code. This tags or content written in this tag is not displayed in the web page. This tag is only for user understand ability.
<!-- your comments here -->

Structure of HTML


The following code shows the basic structure of the html document.

<HTML>
<HEAD>
<TITLE>Displays the title of the document</TITLE>

</HEAD>

<BODY>
<!-- Enter Your Content in this section -->
</BODY>

</HTML>



Coding a Basic HTML Document


Next, add an HTML element around the entire document:

<html>

My Basic Web Page

White spaces, tabs and new lines are ignored by the browsers. For this there are some tags is HTML, now let us study them
</html>

Then place the head and body elements in the document, like so:

<html>
<head>
</head>
<body>

My Basic Web Page

White spaces, tabs and new lines are ignored by the browsers. For this there are some tags is HTML
</body>
</html>


Insert a title element in the head element

<html>
<head>
<title>HTML Tutorial</title>
</head>
<body>
My Basic Web Page
White spaces, tabs and new lines are ignored by the browsers. For this there are some tags in HTML
</body>
</html>


The heading (h1) and paragraph (p) elements go inside the body element, and the page
should render as shown in Figure 1-1:

<html>
<head>
<title>HTML Tutorial</title>
</head>
<body>
<h1>
My first Web Page
</h1>
<p>White spaces, tabs and new lines are ignored by the browsers. For this there are some tags is HTML
</p>
</body>
</html>


Every web page needs to have an HTML element wrapping the entire document. Within each HTML element are two required elements:

Head and Body

The head element contains the information about the document, often called meta information. The head element needs to have the title element within it. This text is usually set in the top portion of the browser window and is used when creating bookmarks. It’s important to be concise and to avoid long descriptions when using the title tag.

<html>
<head>
<title>HTML Tutorial</title>
</head>
<body>
<h1>
My first Web Page
</h1>
<p>White spaces, tabs and new lines are ignored by the browsers. For this there are some tags is HTML
</p>
</body>
</html>


Output:


The Attributes Body


1. BACKGROUND :- This attribute is used to set the background of the page like some images

2. BGCOLOR :- The attribute specifies the color of the browser's background.

3. TEXT :- It specifies the color of the text in the document.

4. BOTTOMMARGIN :- It is used to set the bottom margin of the document in pixels

5. LEFTMARGIN :- It is used to set the left margin of the document in pixels

6. TOPMARGIN :- It is used to set the top margin of the document in pixels

7. RIGHTMARGIN :- It is used to set the right margin of the document in pixels


Example of the body attributes

<html>
<head>
<title>Body attributes</title>
</head>
<body bgcolor="red" topmargin="100px" leftmargin="100px">
Example of the body attributes in HTML
</body>
</html>


Output: