HTML
HTML
Of
Internet and
Web Designing
1|Page
Contents
1. Introduction to HTML ........................................................................................................................... 3
2. Basic Structure of HTML ....................................................................................................................... 4
3. Steps for Creating HTML Document................................................................................................ 5
4. Formatting Tags .................................................................................................................................. 7
5. HTML Presentational Elements ........................................................................................................ 9
6. HTML Phrase Elements ................................................................................................................... 11
7. HTML Comments:............................................................................................................................ 13
8. HTML Lists and Types: ................................................................................................................... 14
9. Hyperlinks and Types: ........................................................................................................................ 15
10. Adding Image to a webpage ......................................................................................................... 18
11. Adding marquee to a webpage ..................................................................................................... 19
12. Creating Table in HTML ............................................................................................................. 20
13. Show the use of ‘Colspan’ and rowspan in table : ........................................................................ 21
14. Crate a general from of student Admission ................................................................................ 22
15. Create a link between frames ....................................................................................................... 26
2|Page
1. Introduction to HTML
3|Page
2. Basic Structure of HTML
An HTML document is composed of following three section:
1. a line containing HTML version information,
2. a declarative header section (delimited by the HEAD element),
3. a body, which contains the document's actual content. The body may be implemented
by the BODY element.
White space (spaces, newlines, tabs, and comments) may appear before or after each section.
Sections 2 and 3 should be delimited by the HTML element.
HTML element: the elements tell the browser what to display, the attributes define how they
will behave.The tags mark the beginning and the end of an element. They may not be necessary
for some elements, especially the closing tags. Equally important, the attributes are only within
the opening tags.
HTML Attribute: In simple words, an HTML attribute is what modifies an HTML element.
It is usually in the form of unique words that one inserts inside the opening tag. They control
the behavior of the element that follows.
Every tag has two sections. The first one is usually the name of the attribute, while the other
one is its value. The two are usually separated by an equals sign (=). Attributes are inside the
start tag of that particular element that needs modification.
4|Page
3. Steps for Creating HTML Document
Step 1—open Notepad
If using a Windows operating system select Start from the Task Bar (typically located in the lower left
corner of the screen).
Screenshot depicting the Windows Operating System icon
In the Search programs and files field, enter Notepad. The Notepad program should then be displayed, then
> select Notepad to open the program.
5|Page
Step 3—save the file as an HTML document
Select File > Save As.
In the File Name field, type the name of the file with an .html extension > select Save.
Please be sure the file name conforms to EDGAR’s file name standards:
File name must be 32 characters or less.
All characters must be lowercase.
File name must start with a letter.
File name cannot contain any spaces.
It may contain digits 0-9.
It may have up to one period (.), one hyphen (-), and one underscore character (_).
Screenshot depicting how to save a Word document as an HTML file in the Save As pop-up window of
Windows
The .html document is now ready to be attached to your filing for submission.
Step 4— Run HTML File in Web Browser
Open Your HTML file and double-click your html file.
The result would be look like this :
6|Page
4. Formatting Tags
HTML Text is written in order to increase it appearance and experience. Users can format text
using HTML without applying CSS. In HTML, there are several formatting tags. Text can really
be highlighted in bold, underscored, or underlined using these tags.
Physical tag: These tags are used to provide the visual appearance to the text.
Logical tag: These tags are used to add some logical or semantic value to the text.
NOTE: There are some physical and logical tags which may give same visual appearance,
Semantics : A semantic element clearly describes its meaning to both the browser and the
developer. Examples of non-semantic elements: <div> and <span> - Tells nothing about its content.
Examples of semantic elements: <form> , <table> , and <article> - Clearly defines its content.
Here, we are going to learn 14 HTML formatting tags. Following is the list of HTML formatting
text.
8|Page
5. HTML Presentational Elements
An HTML file is made of elements. These elements are responsible for creating web pages and define
content in that webpage. An element in HTML usually consist of a start tag <tag name>, close tag </tag
name> and content inserted between them. Technically, an element is a collection of start tag, attributes,
end tag, content between them.
Void element: All the elements in HTML do not require to have start tag and end tag, some elements does
not have content and end tag such elements are known as Void elements or empty elements. These elements
are also called as unpaired tag.
Some Void elements are <br> (represents a line break) , <hr>(represents a horizontal line), etc.
Nested HTML Elements: HTML can be nested, which means an element can contain another element.
Block-level and Inline HTML elements
For the default display and styling purpose in HTML, all the elements are divided into two categories:
▪ Block-level element
▪ Inline element
Block-level element:These are the elements, which structure main part of web page, by dividing a
page into coherent blocks.A block-level element always start with new line and takes the full width
of web page, from left to right.These elements can contain block-level as well as inline elements.
Following are the block-level elements in HTML.
<address>, <article>, <aside>, <blockquote>, <canvas>, <dd>, <div>, <dl>, <dt>, <fieldset>,
<figcaption>, <figure>, <footer>, <form>, <h1>-<h6>, <header>, <hr>, <li>, <main>, <nav>, <noscript>,
<ol>, <output>, <p>, <pre>, <section>, <table>, <tfoot>, <ul> and <video>.
Inline elements:Inline elements are those elements, which differentiate the part of a given text and
provide it a particular function.These elements does not start with new line and take width as per
requirement.
The Inline elements are mostly used with other elements.
<a>, <abbr>, <acronym>, <b>, <bdo>, <big>, <br>, <button>, <cite>, <code>, <dfn>, <em>, <i>, <img>,
<input>, <kbd>, <label>, <map>, <object>, <q>, <samp>, <script>, <select>, <small>, <span>, <strong>,
<sub>, <sup>, <textarea>, <time>, <tt>, <var>.
Following is the list of the some main elements used in HTML:
9|Page
10 | P a g e
6. HTML Phrase Elements
HTML phrase elements are inline elements that define the meaning, structure, or semantics of small pieces
of text within a document. These elements are used to give specific meaning to certain words or phrases,
which can aid in understanding, accessibility, and search engine optimization (SEO).
11 | P a g e
12 | P a g e
7. HTML Comments:
HTML, comments are used to leave notes or explanations within the code that are ignored by the
browser. These comments are not visible on the webpage but are helpful for developers to
understand the structure, logic, or purpose of certain parts of the code.
13 | P a g e
8. HTML Lists and Types:
HTML, lists are used to group related items together, typically displayed in a structured manner. There
are three main types of lists in HTML:
1. Ordered List (<ol>)
An ordered list is used for items that are listed in a specific sequence or order. The items are typically
numbered (or lettered).
2. Unordered List (<ul>)
An unordered list is used when the order of items doesn't matter. The list items are typically marked with
bullet points. 3. Definition List (<dl>)
3. Definition List (<dl>)
A definition list is used to display a list of terms and their corresponding definitions. It consists of the
following elements:
<dt>: Defines the term.
<dd>: Defines the description or definition of the term.
14 | P a g e
9. Hyperlinks and Types:
In HTML, hyperlinks are used to link from one page to another, whether within the same website or to
an external site. Hyperlinks are created using the <a> (anchor) tag, which stands for "anchor" because it
anchors the link to another location.
href: The hyperlink reference or target URL (Uniform Resource Locator) to which the link
points.
Link Text: The clickable text that the user sees on the webpage.
Types of Hyperlinks:
Example:
Example:
This link will take the user to the "about.html" page in the same directory.
o
You can also use paths to navigate directories:
href="folder/page.html": Link to a file in a subfolder.
href="../page.html": Link to a file in the parent folder.
3. Anchor Links (Internal Page Navigation):
o Links to a specific section within the same page.
o The target section must have an id attribute.
Example:
4. Email Links:
o Links that open the user's email client to send an email.
o Use mailto: followed by the email address.
Example:
15 | P a g e
<a href="mailto:[email protected]">Email Us</a>
This link will open the email client to send a message to "[email protected]".
5. Telephone Links:
o Links that prompt the user to dial a phone number (mainly used on mobile devices).
o Use tel: followed by the phone number.
Example:
This link will prompt the device to dial the number +1234567890.
6. Download Links:
o Links that prompt the user to download a file.
o Use the download attribute to specify that the file should be downloaded.
Example:
7. Target Attribute:
The target attribute is used to specify where the linked document will open:
Example:
Hyperlinks are a fundamental part of the web, enabling easy navigation between resources across
different pages and sites.
16 | P a g e
17 | P a g e
10. Adding Image to a webpage
To add an image to a webpage in HTML, you use the <img> tag. This tag is self-closing, meaning it does
not have a closing tag. It is used to embed images into a web page.
Basic Syntax:
<img src="image_url" alt="description" />
src (source): Specifies the path or URL of the image file.
alt (alternative text): Provides a description of the image, which is displayed if the image cannot be
loaded and is important for accessibility.
Common Attributes:
width and height: Set the width and height of the image (in pixels or percentages).
alt: Provides a text description for screen readers or if the image fails to load.
title: Displays a tooltip when you hover over the image.
Example with width, height, and title:
<img src="path_to_image.jpg" alt="A beautiful sunset" width="600" height="400" title="Hover text:
Sunset image" />
This example adds an image to the webpage, sets its size, and provides hover text for additional context.
18 | P a g e
11. Adding marquee to a webpage
The <marquee> tag is used to create a scrolling text or image in HTML. However, it's important to note
that this tag is deprecated in HTML and is no longer recommended for use in modern web development
because it is not supported in HTML5. For modern usage, CSS animations should be used instead.
That said, here’s how the <marquee> tag works:
Basic Syntax of <marquee>:
<marquee>Scrolling text goes here</marquee>
19 | P a g e
12. Creating Table in HTML
In HTML, tables are created using the <table> element along with several other tags to define the rows
and columns. Here's a breakdown of the basic structure for creating a table:
Basic Table Elements:
<table>: Defines the table.
<tr> (table row): Defines a row within the table.
<th> (table header): Defines a header cell within the table (usually bold and centered by default).
<td> (table data): Defines a regular cell within the table.
20 | P a g e
13. Show the use of ‘Colspan’ and rowspan in table :
The colspan and rowspan attributes in HTML tables are used to merge cells horizontally and vertically,
respectively.
colspan:
The colspan attribute is used to make a cell span across multiple columns.
rowspan:
The rowspan attribute is used to make a cell span across multiple rows.
Here’s an example that demonstrates both colspan and rowspan in a table:
21 | P a g e
14. Crate a general from of student Admission
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admission Form</title>
</head>
<body>
<div class="container">
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
<label>Gender:</label>
<div class="gender-options">
</div>
</div>
22 | P a g e
<!-- Phone Number -->
<div class="form-group">
<div>
</select>
</div>
</div>
<div class="form-group">
<label for="address">Address:</label>
</div>
<div class="form-group">
<label for="email">Email:</label>
</div>
<div class="form-group">
<label for="password">Password:</label>
</div>
<div class="form-group">
23 | P a g e
<label for="confirmPassword">Re-type Password:</label>
</div>
<div class="form-group">
<label for="category">Category:</label>
<option value="general">General</option>
<option value="sc">SC</option>
<option value="st">ST</option>
<option value="obc">OBC</option>
<option value="other">Other</option>
</select>
</div>
<div class="form-group">
<label for="course">Course:</label>
<option value="bsc">B.Sc.</option>
<option value="ba">B.A.</option>
<option value="bcom">B.Com</option>
<option value="btech">B.Tech</option>
<option value="mba">MBA</option>
<option value="msc">M.Sc.</option>
</select>
</div>
<div class="form-group">
24 | P a g e
<button type="submit">Submit</button>
</div>
</form>
</div>
</body>
</html>
25 | P a g e
15. Create a link between frames
Step 1: Crate a file ”NF1.html”with tis following code :
26 | P a g e