Schoolans.com

Unit III- Lesson 2 HTML

Introduction

HTML stands for Hyper Text Markup Language. HTML is the standard markup languages for Web pages. HTML elements are the building blocks of HTML pages.

It is developed by Tim Berners- Lee in 1990. HTML is short form of Hypertext Markup Language. HTML is used to create electronic documents ( called pages ) that are displayed on the World Wide Web.

Creating HTML

HTML is created in text editor like notepad, notepad++ with its formation. It should be saved with the extension HTML. THen, It will be run or executed in the web browser

STEPS TO CREATE A SIMPLE HTML DOCUMENTS

  1. Open notepad or notepad++ which is available in your computer.
  2. The following steps are of notepad++. If you have notepad, it’s ok.
  3. Go on typing the HTML documents.
  4. You have to start with <HTML> and close with </HTML>. They are called tags. IN between These two tags whatever you type, it will be executed.
  5. Let’s type “Hello, Welcome to my first webpage.”
  6. Then save the document in “welcomes 1.html” from drop list box as follows:
  7. Select file-> save as
  8. In the save as dialog box if you are using notepad select “all”
  9. If you are using notepad++ select “HTML” from drop down list box.Then type the filename: welcomes 1.html
  10. Select save button.
  11. Select the folder where you have saved it.

According to your default browser the icon will appear with your HTML document.Well done, if you have seen the text what you have typed in the notepad without <HTML></HTML> tags, it’s great.

HTML tags

There are two types of HTML< tags. THey container tag any empty tag. Container tags are ended by ending tag and empty tag has no ending tag.

<html></html> – container tag

<hr> – empty tag

HTML <html> Tag

The <html> tag tells the browser that this is an HTML document.

The <html> tag represents the root of an HTML document.

The <html> tag is closed by </HTML>

<HTML> is a container class.

THe container or non-empty is the area enclosed by the beginning and ending tags. For example, < HTML > encloses an entire document while other tags may enclose a single word, paragraph, or other elements. IN HTML code, all container must have a start and stop tag to close the container.

Opening TagClosing Tag Description
<HTML></HTML>Starts and stops an HTML document
<HEAD></HEAD>The first of two main sections of an HTML document. The <head>
section is used to provide information about the document for
use primarily by search engines and browser.

Opening and Formatting HTML Document

<HTML> tag we have used, but there is no <HEAD>. <HEAD> tag is used for creating the information section about the document for use properly by search engines and browser.

Open welcomes 1.html document and add a heading as follows:

Do not forget to save each time when you edit the document.

<TITLE> tag

<TItle></title>:

The title of document. This element is nested inside the <head> section. Let’s add title in our welcome page. It appears on the top of the screen ( title bar ).

Title Tag

Save and run the browser.

<BODY> tag

<body></body>:

It is the second main section of HTML document. IT is the body section. THe <body> section contains all the content of the web page. In our document Hello, Welcome to my first webpage should be inside the <BODY>tag.

Let’s edit again:

SHASHAT Group: HTML Editors

After saving execute again

The content of the body should be under <BODY> tag. Whatever you like to display on the page, it must be written under the <BODY tag.

BGCOLOR

The <BODY BGCOLOR> attribute a background color for an HTML document. Syntax: <BODY BGCOLOR=”color_name”>. THe color value can be either a color name ( like, purple ) or a hex value ( like, #af0000 ). To add a background color to a webpage, you can use the <body bgcolor=”######”> attribute.

List of common HTML color codes

Color NameHex Color CodeRgb Color code
White#FFFFFFRGB(255, 255, 255)
Silver#COCOCORGB(192, 192, 192)
Gray#808080RGB(128, 128, 128)
Black#000000RGB(0, 0, 0)
Red#FF0000RGB(255, 0, 0)
Maroon#800000RGB9128, 0, 0)
Yellow#FFFF00RGB(255, 255, 0)
Olive#808000RGB(128, 128, 0)
Lime#00FF00RGB(0, 255, 0)
Green#008000RGB(0, 128, 0)
Aqua#00FFFFRGB(0, 255, 255)
Teal#008080RGB(0, 128, 128)
Blue#0000FFRGB(0, 0, 255)
Navy#000080RGB(0, 0, 128)
Fuchsia#FF00FFRGB(255, 0, 255)
Purple#800080RGB(128, 0, 128)

Leave a Comment

Your email address will not be published. Required fields are marked *