Introduction to HTML
What is a website?
A website is a collection of web pages which contains the information about the
particular organization or institution or any product. It contains the related
content that is identified by a common domain name and published on one or
many web servers. Few examples of such websites are [Link], [Link],
[Link], [Link] etc.
A website can be opened using the software known as Browser. Commonly used
browsers are Google Chrome, Microsoft Edge, Mozilla Firefox, Safari etc.
Types of Website:
• Static Website
• Dynamic Website
A static website is one where web pages are delivered exactly as they are
stored, with no real-time content changes. In contrast, a dynamic website
generates content in real time, typically using databases and scripting languages
to provide interactivity and personalized experiences.
HTML is web-based Client-side scripting language used to develop different
webpages and websites. It stands for Hyper Text Markup Language. It was
created by Berners-Lee in 1991 A.D.
Prerequisites to writing a HTML program You will need a text editor, such as
Notepad and an Internet browser, such as Internet Explorer or Netscape
Navigator. You don't need any sophisticated software to write HTML code. We
create HTML documents using text editors and some popular editors are:
Notepad
Notepad++
Sublime Text
Text Edit(Mac OS)
HTML Tags
Tags have a simple structure and they begin with a “”. Between the <> angular
brackets are the tag name and may be some attributes, depending on the tag.
The general form of a tag is: Tag names and attribute names in general are not
case sensitive, but some attributes are case sensitive. The tag name must come
first, but the order of the attributes doesn’t matter. HTML Element an HTML
element is defined by a start tag, some content, and an end tag. An HTML
attribute provides additional information about an HTML element.
All HTML elements can have attributes
Attributes provide additional information about an element/tag
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name="value"
Running an HTML file using a browser involves a simple process:
1. Save your HTML code :
Open a text editor like Notepad (Windows) or TextEdit (Mac).
Type your HTML code in the editor.
Save the code as a file with a .html or a .htm extension. For example, you
can save it as [Link].
Open the file in your browser :
Double-clicking the file: This is the most common way. In most operating
systems, double-clicking the HTML file will automatically open it in your
default web browser.
Right-click and select "Open with": If double-clicking doesn't work or you
want to use a specific browser, right-click the file, choose "Open with,"
and then select your preferred browser from the list.
Basic HTML Tags
Tags can be broadly divided into two categories as:
1. Container tags These types of tags require a pair of tags that is a starting
tag and an ending tag. These tags affect the content which is capsulized
between the starting and ending tag. An ending tag is similar to that of a
starting tag except that it begins with a slash (/) symbol. Some of the
container tags are given below:
2. Empty tags These types of tags require only a starting tag instead of a
pair of tags. i.e. it does not require an ending tag. Some of the empty tags
are given below:
Some Important Tags in HTML
<Html> Tag
The tag identifies the document as an HTML document. tag represents the
root of an HTML document. So, it acts as the container tag for all other
HTML elements. All HTML documents start with tag and end with
tag.
<Head>Tag
The tag defines the document header and does not affect the appearance
of the document in the browser window. The element can also include a
title for the document.
<TITLE> Tag
The <TITLE> tag defines the title of the document. It is placed between
<HEAD> and
</HEAD> tags. Each document can have only one title which should
identify the document content in a general way. The title is not a part of
the document text and cannot contain hypertext links or special markup
commands. It must be simple text.
<BODY> Tag
The <BODY> tag defines the largest part of an HTML document, i.e. the
body. This tag
contains all the major content of the document such as text, images, lists,
tables,
hyperlinks, etc.
Tables
HTML tables, defined using the <table> tag and its associated elements,
provide a way
to structure and present tabular data in a web page. They allow you to
organize
information into rows and columns, enhancing readability and clarity for
users. We can
create tables and display text, number, etc., in tabular form using the
following:
➢ Tables are defined with the <TABLE> container tag.
➢ For adding a new row to the table use <TR> container tag (TR is for
Table row) .
➢ For adding a new column in a row use <TH> container tag (TH is for
Table
Heading) or use <TD> container tag (TD is for Table Data).