Web Unit 2nd
Web Unit 2nd
HTML Fundamentals
Introduction to HTML
HTML stands for Hyper Text Markup Language which is used for creating web pages and web
applications.
Tim Berners-Lee is known as the father of HTML. The first available description of HTML was a
document called "HTML Tags" proposed by Tim in late 1991. The latest version of HTML is HTML5,
HTML Versions
HTML 1.0 The first version of HTML was 1.0, and it was released in1991.
HTML 2.0: This was the next version which was released in 1995.
HTML 3.2: HTML 3.2 version was published by W3C in early 1997.
HTML 4.01: HTML 4.01 version was released on December 1999.
HTML5: HTML5 is the newest version of HyperText Markup language. The first draft of this
version was announced in January 2008.
There are two major organizations one is W3C (World Wide Web Consortium), and another one is
WHATWG (Web Hypertext Application Technology Working Group) which are involved in the
development of HTML 5 version, and still, it is under development.
Features of HTML
1) It is a very easy and simple language. It can be easily understood and modified.
2) It is very easy to make an effective presentation with HTML because it has a lot of formatting tags.
3) It is a markup language, so it provides a flexible way to design web pages along with the text.
5) It is platform-independent because it can be displayed on any platform like Windows, Linux, and
Macintosh, etc.
6) It facilitates the programmer to add Graphics, Videos, and Sound to the web pages which makes it
more attractive and interactive.
7) HTML is a case-insensitive language, which means we can use tags either in lower-case or upper-
case.
Web Browser:
A browser is a software application that allows users to access and browse information on the internet.
It serves as an interface between the user and the web content, displaying text, images, videos, and
other multimedia files. Browsers use various protocols, such as HTTP, HTTPS, FTP, and others, to
communicate with web servers and retrieve web pages. They also provide features like bookmarking,
tabbed browsing, history, and security options to enhance the user experience. Some popular
browsers include Google Chrome, Mozilla Firefox, Apple Safari, Microsoft Edge, and Opera.
Text Editor: An editor is a software application that is used for creating, modifying, and managing
text-based files, such as source code, scripts, documents, and configuration files. Text editors provide
features for editing and formatting text, searching and replacing text, syntax highlighting, and code
completion. There are different types of editors available, including code editors, IDEs (Integrated
Development Environments), and text editors. Some popular code editors and IDEs include Visual
Studio Code, Sublime Text, Atom, Eclipse, IntelliJ IDEA, and NetBeans, while some popular text editors
include Notepad++, Vim, Emacs, and Nano.
1. Notepad++: a free source code editor for Windows that supports multiple programming
languages.
2. Sublime Text: a cross-platform text editor that supports a wide range of programming
languages and provides advanced features such as split editing, multiple selections, and macros.
3. Atom: a free and open-source text editor developed by GitHub that provides a modern interface
and extensibility through plugins.
4. Visual Studio Code: a cross-platform source code editor developed by Microsoft that supports
multiple programming languages and provides advanced features such as debugging, version
control, and extensions.
5. Vim: a command-line text editor that is popular among programmers for its powerful editing
commands and customization options.
Hyper Text: Hyper Text simply means "Text within Text. Hyper Text is a way to link two or more web
pages with each other. Whenever you click on a link which brings you to a new webpage, you have
clicked on a hypertext.
Markup language: A markup language is a computer language that is used to apply layout and
formatting conventions to a text document. Markup language makes text more interactive and
dynamic. It can turn text into images, tables, links, etc.
Web Page: A web page is a document which is commonly written in HTML and translated by a web
browser. A web page can be identified by entering an URL. A Web page can be of the static or dynamic
type. With the help of HTML only, we can create static web pages.
Website: A website is a collection of many web pages, and web pages are digital files that are written
using HTML (Hypertext Markup Language).
The website’s web pages are linked with hyperlinks and hypertext and share a common interface and
design. The website might also contain some additional documents and files such as images, videos, or
other digital assets.
Types of Websites:
Static Website
Dynamic Website
Static Website: In Static Websites, Web pages are returned by the server which are prebuilt source
code files built using simple languages such as HTML, CSS, or JavaScript. There is no processing of
content on the server (according to the user) in Static Websites. Web pages are returned by the server
with no change therefore, static Websites are fast. There is no interaction with databases. Also, they are
less costly as the host does not need to support server-side processing with different languages.
Dynamic Website: In Dynamic Websites, Web pages are returned by the server which is processed
during runtime means they are not prebuilt web pages, but they are built during runtime according to
the user’s demand with the help of server-side scripting languages such as PHP, Node.js, ASP.NET and
many more supported by the server. So, they are slower than static websites but updates and
interaction with databases are possible. Dynamic Websites are used over Static Websites as updates
can be done very easily as compared to static websites (Where altering in every page is required) but
in Dynamic Websites, it is possible to do a common change once, and it will reflect in all the web pages.
HTML is a markup language which is used for creating attractive web pages with the help of styling,
and which looks in a nice format on a web browser. An HTML document is made of many HTML tags
and each HTML tag contains different content.
o Tags: HTML tags are like keywords which defines that how web browser will format and display
the content. An. HTML tags contain three main parts: opening tag, content and closing tag. But
some HTML tags are unclosed tags. HTML tags are used to create HTML documents and render
their properties. Each HTML tags have different properties.
o All HTML tags must be enclosed within < > these brackets.
o Every tag in HTML performs different tasks.
o If you have used an open tag <tag>, then you must use a close tag </tag> (except
some tags)
o Attribute: An attribute in HTML provides extra information about the element, and it is applied
within the start tag. Each element or tag can have attributes, which defines the behaviour of that
element. An HTML attribute contains two fields: name & value.
Syntax
Elements: An HTML element is an individual component of an HTML file. In an HTML file, everything
written within tags are termed as HTML elements.
<!DOCTYPE>
<html>
<head>
<title>Title for web Page</title>
</head>
<body>
Content for html web document
</body>
</html>
The <!DOCTYPE html> : It defines the document type or it instruct the browser about the
version of HTML document.
The <html> element is the root element of an HTML page
The <head> element contains meta information about the HTML page
The <title> element specifies a title for the HTML page (which is shown in the browser's title
bar or in the page's tab)
The <body> element defines the document's body, and is a container for all the visible contents,
such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
These are just a few of the many HTML tags available for use in web development. The specific tags
and attributes used will depend on the requirements of the project and the desired layout and
functionality of the web page.
Formatting Tag:
Formatting tags in HTML are used to apply visual styling and formatting to text and other content on
a web page. These tags specify how the content should appear to the user, including its color, size, font
family, and other properties.
1. Text formatting tags: These tags are used to format text, including making text bold, italic,
underlined, or strikethrough. Examples of text formatting tags-
<b> and <strong>: Bold text
SHEKHAWATI INSTITUTE, SIKAR 6
<i> and <em>: Italic text
<u>: Underlined text
<s>: Strikethrough text
<sub>: Subscript text
<sup>: Superscript text
<font>: Specifies the font family, size, and color of text
<hr>: Horizontal rule to create a visual divider between content
<br>: Line break to create a new line of text
<center>: Center aligns the content within the tag.
2. Heading tags: These tags are used to create headings for sections of content on a web page.
There are six levels of headings, ranging from <h1> for the most important heading to <h6> for
the least important heading.
3. List tags: These tags are used to create lists of items. There are two types of lists: ordered lists
(<ol>) and unordered lists (<ul>).
4. Image tags: These tags are used to display images on a web page. The <img> tag is used to
insert an image, and attributes such as src, alt, and width can be used to specify the image
source, alternative text, and image size.
5. Table tags: These tags are used to create tables on a web page. The <table>, <tr>, <th>, and
<td> tags are used to define the structure of the table, including its rows, columns, and headers.
6. Form tags: These tags are used to create forms that allow users to enter data and submit it to
a server. The <form>, <input>, and <button> tags are used to create form elements such as
text boxes, checkboxes, radio buttons, and submit buttons.
HTML5 doctype
The HTML5 doctype declaration is as follows:
<!DOCTYPE html>
This declaration is used at the beginning of an HTML document to indicate that the document is written
in HTML5. The DOCTYPE keyword is followed by the name of the document type, which is html in this
case. The declaration is enclosed in angle brackets <> and followed by a closing bracket >.
The HTML5 doctype declaration is different from the doctype declarations used in earlier versions of
HTML, such as HTML 4.01 or XHTML. In HTML5, the doctype declaration is much simpler and does not
require any additional information such as a URL or version number.
It is important to include the doctype declaration at the beginning of an HTML document, as it helps
web browsers to render the page correctly by indicating the version of HTML being used. This can
prevent compatibility issues and ensure that the page displays correctly across different devices and
browsers.
HTML5 introduced several new structural elements that are commonly used in modern web
development. Here are a few examples:
1. <header> - This tag is used to define the header section of a web page, typically containing the
site logo, navigation menu, and other introductory content.
2. <main> - This tag is used to define the main content section of a web page, typically containing
the primary content and features of the page.
3. <section> - This tag is used to group related content within a web page, such as a section
containing a list of articles or products.
4. <article> - This tag is used to define an independent piece of content within a web page, such
as a blog post, news article, or product review.
5. <aside> - This tag is used to define a section of a web page that contains content related to the
main content, such as a sidebar or a section containing related articles.
6. <footer> - This tag is used to define the footer section of a web page, typically containing
copyright information, contact details, and other related content.
These structural elements can help to improve the accessibility and semantics of web pages, making it
easier for users and search engines to understand the content and structure of a website. They can also
provide additional styling and formatting options for web developers, allowing for more flexible and
modular page layouts.
HTML semantics
HTML semantics refers to the use of HTML elements to give meaning and structure to the content of a
web page. By using semantic elements, developers can create web pages that are more accessible,
more easily understood by search engines, and more maintainable over time.
1. <header> - This element is used to define the header of a web page or section.
2. <nav> - This element is used to define the navigation menu of a web page.
3. <main> - This element is used to define the main content of a web page.
4. <section> - This element is used to define a section of a web page.
5. <article> - This element is used to define a self-contained piece of content, such as a blog post
or news article.
6. <aside> - This element is used to define content that is related to the main content of a web
page, but not necessarily part of it.
7. <footer> - This element is used to define the footer of a web page or section.
Using these semantic elements not only helps to structure the content of a web page, but also provides
important information to assistive technologies such as screen readers, which can improve accessibility
<section> tag
The <section> tag is a semantic HTML5 element used to define a section of content within a web page.
It is used to group related content together and give it a clear and identifiable title or heading.
The <section> tag is often used in conjunction with other HTML5 semantic elements like <article>,
<header>, <footer>, and <nav> to create well-structured and meaningful web pages.
Here is an example of how the <section> tag could be used to group related content on a web page:
<section>
<h2>Our Services</h2>
<p>We offer a range of services to meet your needs, including:</p>
<ul> <li>Web design and development</li>
<li>Search engine optimization (SEO)</li>
<li>Social media marketing</li>
<li>Content creation and copywriting</li>
</ul>
</section>
In this example, the <section> tag is used to group together information about the different services
offered by a business. The <h2> tag is used to provide a heading for the section, while the <p> tag
and <ul> tag are used to provide more detailed information about each service.
Using the <section> tag and other semantic HTML5 elements can help to improve the accessibility and
structure of web pages, making them easier for users and search engines to understand.
<nav> tag
The <nav> tag is a semantic HTML5 element that is used to define a section of a web page that contains
navigation links. It is typically used to wrap a list of links that enable users to navigate between different
pages or sections of a website.
Here is an example of how the <nav> tag could be used to define a navigation menu on a web page:
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
In this example, the <nav> tag is used to wrap a list of navigation links that allow users to navigate
between different sections of a website. The links are contained within an unordered list (<ul>) and
each link is represented by a list item (<li>) and an anchor tag (<a>).
Using the <nav> tag helps to provide a clear structure to the navigation section of a website, making
it easier for users to find the information they are looking for. It also provides additional information to
search engines, which can improve the website's search engine ranking.
<article> tag
The <article> tag is a semantic HTML5 element used to define a self-contained, independent piece of
content within a web page. It is typically used to wrap content that can stand alone and is not necessarily
tied to the rest of the page.
Here is an example of how the <article> tag could be used to define a news article on a web page:
<article>
<h2>Scientists discover new species of bird</h2>
<p>Scientists in the Amazon rainforest have discovered a new species of bird that
is unlike any previously known bird. The bird has distinctive coloring and a unique
song, and is believed to be an important discovery for ornithologists.</p>
<p>The discovery was made by a team of scientists from the University of
Amazonia, who spent several months studying the bird in its natural habitat. They
have named the bird "Amazonian bluebird" and have published their findings in
the journal "Ornithology Today".</p>
<p>The discovery of the Amazonian bluebird is a significant one, as it is rare for
new species of birds to be discovered in the modern era. The bird is already
generating excitement among birdwatchers and conservationists, who hope that
its discovery will help to raise awareness of the importance of preserving the
Amazon rainforest.</p>
</article>
In this example, the <article> tag is used to wrap a news article, which contains a headline, several
paragraphs of text, and additional information about the discovery. The article is self-contained and
can be read on its own, without needing to refer to the rest of the page.
Using the <article> tag helps to provide a clear structure to the content of a web page, making it easier
for users to understand and navigate. It also provides additional information to search engines, which
can improve the website's search engine ranking.
SHEKHAWATI INSTITUTE, SIKAR 10
<aside> tag
The <aside> tag is a semantic HTML5 element that is used to define a section of a web page that is
related to the main content, but not an integral part of it. It is often used to wrap content that provides
additional information, such as related links, quotes, or advertisements.
Here is an example of how the <aside> tag could be used to define a section containing related links
on a web page:
<main>
<article>
<p>Scientists in the Amazon rainforest have discovered a new species of bird that is unlike any
previously known bird. The bird has distinctive coloring and a unique song, and is believed to be an
important discovery for ornithologists.</p>
<p>The discovery was made by a team of scientists from the University of Amazonia, who spent several
months studying the bird in its natural habitat. They have named the bird "Amazonian bluebird" and
have published their findings in the journal "Ornithology Today".</p>
<p>The discovery of the Amazonian bluebird is a significant one, as it is rare for new species of birds
to be discovered in the modern era. The bird is already generating excitement among birdwatchers and
conservationists, who hope that its discovery will help to raise awareness of the importance of
preserving the Amazon rainforest.</p>
</article>
<aside>
<h3>Related links</h3>
<ul> <li><a href="#">Learn more about the Amazon rainforest</a></li>
<li><a href="#">Discover other new species recently discovered</a></li>
<li><a href="#">Support conservation efforts in the Amazon</a></li> </ul>
</aside>
</main>
In this example, the <aside> tag is used to wrap a section containing related links that provide
additional information about the topic of the article. The links are contained within an unordered list
(<ul>) and are presented with a heading (<h3>).
Using the <aside> tag helps to provide a clear structure to the content of a web page, making it easier
for users to understand and navigate. It also provides additional information to search engines, which
can improve the website's search engine ranking.
Here is an example of how the <header> and <footer> tags could be used to define the top and
bottom sections of a web page:
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
</head>
<body>
<header>
<h1>Welcome to my web page!</h1>
<nav>
<ul> <li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
<article>
<h2>My first blog post</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget
massa libero. Integer posuere, nisl nec mattis facilisis, ante tellus rhoncus
libero, eget fermentum lectus lectus vel mi. Fusce tincidunt interdum sapien
vel sagittis. </p>
</article>
<article>
<h2>My second blog post</h2>
<p>Nulla accumsan, augue sed lacinia eleifend, enim sapien scelerisque
est, non iaculis velit dolor eu nunc. Nullam mollis augue sed ipsum ultrices
consectetur. Aliquam venenatis, massa at imperdiet dictum, ipsum turpis
pharetra nisi, ut fringilla nibh massa vel nulla. </p>
</article>
</main>
<footer>
<p>© 2023 My Web Page. All rights reserved.</p>
</footer>
</body>
</html>
SHEKHAWATI INSTITUTE, SIKAR 12
In this example, the <header> tag is used to define the top section of the web page, which contains
a heading (<h1>) and a navigation menu (<nav>). The <footer> tag is used to define the bottom
section of the web page, which contains a copyright notice (<p>).
Using the <header> and <footer> tags helps to provide a clear structure to the content of a web page,
making it easier for users to understand and navigate. It also provides additional information to search
engines, which can improve the website's search engine ranking.
HTML Attributes:
HTML attributes provide additional information about an HTML element, and are used within the start
tag of an element. An attribute consists of two parts: an attribute name and an attribute value, separated
by an equal’s sign (=).
For example, the <a> tag is used to create hyperlinks, and has an href attribute that specifies the URL
of the destination page:
1. Global attributes: These are attributes that can be used on any HTML element. Some examples
of global attributes include class, id, style, and title.
2. Element-specific attributes: These are attributes that are specific to certain HTML elements.
For example, the <a> element has attributes like href, target, and rel, while the <img> element
has attributes like src, alt, and width.
Example:
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
</body>
</html>
HTML Paragraph tag: The <p> tag in HTML defines a paragraph. These have both opening
and closing tags. So, anything mentioned within <p> and </p> is treated as a paragraph. If a
user adds multiple spaces, the browser reduces them to a single space. If a user adds multiple
lines, the browser reduces them to a single line.
Example:
<!DOCTYPE html>
<html>
<body>
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>
<p>
This paragraph
<p>
The number of lines in a paragraph depends on the size of the browser window. If
you resize the browser window, the number of lines in this paragraph will change.
</p>
</body>
</html>
Output:
The <a> tag defines a hyperlink, which is used to link from one page to another.
The most important attribute of the <a> element is the href attribute, which indicates the link's
destination.
HTML img Tag: The HTML <img> tag is used to insert an image into a webpage. It is a self-closing tag, which
means it does not require a closing tag. Here is an example of how the <img> tag can be used:
In this example, the width and height attributes specify the dimensions of the image in pixels. The title
attribute provides a tooltip that is displayed when the user hovers over the image with their mouse.
The style attribute allows you to apply CSS styles to the image, such as a border.
Note: That the src attribute is required for the <img> tag to function properly. If the src attribute is
missing or the image file cannot be found, the image will not be displayed on the webpage.
<audio> tag: The <audio> tag is used to embed audio content in a webpage. It can be used
to play audio files such as MP3, Ogg Vorbis, or WAV. Here is an example of how to use the <audio>
tag:
<audio controls>
<source src="music.mp3" type="audio/mpeg">
<video> tag: The <video> tag is used to embed video content in a webpage. It can be used
to play video files such as MP4, WebM, or Ogg. Here is an example of how to use the <video> tag:
In this example, the width and height attributes set the dimensions of the video player. The
controls attribute adds controls such as play, pause, and volume to the video player. The <source> tag
is used to specify the location and file type of the video file. If the browser does not support any of the
specified file types, the fallback text "Your browser does not support the video tag" will be displayed.
Both the <audio> and <video> tags can also include additional attributes such as preload,
autoplay, and loop. These attributes can be used to specify whether the media should be preloaded,
automatically played, or looped.
Both the <audio> and <video> tags have a number of attributes that can be used to customize
their behavior. Here is a list of some of the most commonly used attributes:
src: Specifies the URL of the media file to be played.
autoplay: Specifies that the media should start playing automatically when the page loads.
controls: Specifies that controls (such as play, pause, and volume) should be displayed for the media
player.
loop: Specifies that the media should loop and play again after it finishes.
preload: Specifies how the media should be preloaded. The possible values are "none" (no
preloading), "metadata" (only metadata is preloaded), and "auto" (the whole media file is
preloaded).
muted: Specifies that the media should be muted by default.
poster: Specifies an image to be displayed while the media is downloading or before it is played.
width and height: Specify the dimensions of the media player.
playbackRate: Specifies the playback rate of the media (e.g. 1.5x or 0.5x).
currentTime: Specifies the current playback time of the media (in seconds).
volume: Specifies the volume of the media (a value between 0 and 1).
Font Tag: The <font> tag is an HTML element that is used to define the font, size, and color of text
in a web page. However, it is now deprecated and is no longer recommended to be used in modern
HTML documents. Instead, it is recommended to use Cascading Style Sheets (CSS) to style text.
In the example above, the <font> tag is used to specify that the text should be displayed in size 4 and
red color.
Note: that the use of the <font> tag is discouraged and it is recommended to use CSS for styling
instead.
layout
In web design, layout refers to the way in which the various elements of a web page are arranged and
positioned relative to each other. This includes the placement of text, images, and other media, as well
as the use of whitespace, margins, and padding to create a visually appealing and easy-to-navigate
design.
There are several different approaches to web layout, including fixed layout, fluid layout, and responsive
layout. Fixed layout involves specifying a fixed width for the page, while fluid layout adjusts to the width
of the user's screen. Responsive layout takes this concept a step further, using media queries and other
techniques to dynamically adjust the layout of the page based on the size and orientation of the user's
screen.
Effective layout is an important aspect of web design, as it can impact how users interact with and
perceive a website. A well-designed layout can help guide users to important content, create a sense
of hierarchy and organization, and contribute to the overall user experience.
Syntax:
<iframe src="URL" title="description"></iframe>
HTML Table:
HTML table tag is used to display data in tabular form (row * column). There can be many columns in a row. We can create
a table to display data in tabular form, using <table> element, with the help of <tr> , <td>, and <th> elements. In Each
table, table row is defined by <tr> tag, table header is defined by <th>, and table data is defined by <td> tags.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Student Record</h1>
<table>
<tr>
<th>Roll Number</th>
<th>Name</th>
</tr> Student Record
<tr> Roll Number Name
<td>101</td>
<td>sonu</td> 101 sonu
</tr>
<tr> 102 monu
<td>102</td>
<td>monu</td> 104 ronu
</tr>
<tr> 103 tonu
<td>104</td>
<td>ronu</td>
</tr>
<tr>
<td>103</td>
<td>tonu</td>
</tr>
</table>
</body>
</html>
Table attributes in HTML are used to customize table such as changing its background color, alignment, width,
border, etc.
align Horizontal alignment of text in each cell within the row. It can <tr align="">...</tr>
be one of the following values: left, center, right, justify, char
bgcolor Background color of each cell within a row <tr
bgcolor="">...</tr>
valign Vertical alignment of text of each cell within a row. It can be <tr valign="">...</tr>
one of the following values: baseline, bottom, middle, top
colspan Number of columns the cell extends (Default is 1, max value is <th colspan
1000) ="">...</th>
<td
colspan="">...</td>
</tr>
<table width="500px" align="center" frame="border"
rules="rows"> <tr height="50px" bgcolor="#CC3300"
<caption><h1>This is student Table 2 </h1></caption> align="center">
<tr height="100px" valign="middle" align="center"> <td >Tr tag 5</td>
<td>jatin</td>
<td>kumawat </tr>
</td>
</table>
</tr>
<tr> </body>
<td>subhash</td>
</html>
<td>soni
</td>
</tr>
</table>
<td>col 2</td>
<td>col 3</td>
<td>col 4</td>
Form Tag: An HTML form is a section of a document which contains controls such as text fields,
password fields, checkboxes, radio buttons, submit button, menus etc. An HTML form facilitates the
user to enter data that is to be sent to the server for processing such as name, email address, password,
phone number, etc.
Syntax:
<form action="server_url" method="get | post">
//input controls Fields e.g. textfield, textarea, radiobutton, button
</form>
Method
The method attribute is used to define the HTTP method of the form which is either GET or POST.
The GET method will append the form data to the URL specified in the action attribute.
The POST method is used when submitting data to a script. The POST method does not append the
form data to the action URL but sends using the request body.
Target attribute
The target attribute specifies a name or a keyword that indicates where to display the response that is
received after submitting the form.
The target attribute defines a name of, or keyword for, a browsing context (e.g., tab, window, or inline
frame).
Attribute Values
_blank The response is displayed in a new window or tab
_self The response is displayed in the same frame (this is default)
_parent The response is displayed in the parent frame
_top The response is displayed in the full body of the window
framename The response is displayed in a named iframe
Enctype Specifies: Enctype Specifies how the form-data should be encoded when submitting it to the
server (only for method="post").
Example:
<form method="post" enctype="multipart/form-data" action="upload.php">
Input Tag: The input tag is used within < form> element to declare input controls that allow
users to input data. An input field can be of various types depending upon the attribute type.
The Input tag is an empty element which only contains attributes. For defining labels for the
input element, < label> can be used.
Placeholder: Placeholder attribute is used to specify hint that describes the expected value
of an input field.
Checked: When the value of the type attribute is radio or checkbox, the presence of this
Boolean attribute indicates that the control is selected by default; otherwise it is ignored.
Required: HTML5 Indicates a value must be present or the element must be checked in order
for the form to be submitted.
Value: The value attribute is used to specify the value of the input element.
maxlength: This property is used to specifies the maximum number of characters allowed in
an <input> element.
<label>Father's Name:</label>
<input type="text" name="Fathername" value=""><br>
<label>Mobile Number:</label>
<input type="number" name="mobile" value=""><br>
<label>Email Address:</label>
<input type="email" name="email" value="" placeholder="Email
Address"><br>
<label>Date Of Birth</label>
<input type="date" name="dob" value=""><br>
<label>Gender</label>
<input type="radio" name="gender" value="Male">Male
<input type="radio" name="gender" value="female">FeMale
<br>
<label>Hobbies:</label>
<input type="checkbox" name="hobbi" value="writing">Writing
<input type="checkbox" name="hobbi1"
value="photography">Photography
<input type="checkbox" name="hobbi2" value="cooking">Cooking
<input type="checkbox" name="hobbi3" value="learning">Learning
<input type="checkbox" name="hobbi4" value="singing">Singing
<input type="checkbox" name="hobbi5" value="dance">Dance
<br>
<label>Address:</label>
<textarea name="address" placeholder="Student Permanent Address" >
</textarea>
<br>
<form>
<label>Name:</label>
<input type="text" name="name" value="">
<br><br>
<label>E-mail:</label>
<input type="email" name="emailaddress">
<br><br>
<label>Password: </label>
<input type="password" name="password">
<br><br>
<input type="submit">
</form>
</body>
HTML Lists
HTML Lists are used to specify lists of information. All lists may contain one or more list elements.
There are three different types of HTML lists:
1. Ordered lists.
2. Unordered lists.
3. Description lists.
1. Ordered List: Ordered lists use ordinal sequences to indicate the order of list elements. An
ordered list can be created with the <ol> tag and each list item can be created with the <li> tag.
Example:
<ol>
<li>Item</li>
<li>Another Item</li>
<li>Yet Another Item</li>
</ol>
1. Item
2. Another Item
3. Yet Another Item
You can easily change the type of numeral shown in the list item marker by using the type attribute
<ol type="1|a|A|i|I">
2. Unordered List: unordered lists use a defined symbol such as a bullet to list elements in no
designated order. An unordered list can be created with the <ul> tag and each list item can be
created with the <li> tag.
Example:
<ul>
<li>Item</li>
<li>Another Item</li>
<li>Yet Another Item</li>
</ul>
Item
Another Item
Yet Another Item
3. Description lists: description lists use indents to list elements with their children. A description
list (or definition list, as it was called before HTML5) can be created with the dl element. It consists
of name-value groups, where the name is given in the dt element, and the value is given in the
dd element.
Example:
<dl>
<dt>name 1</dt>
<dd>value for 1</dd>
<dt>name 2</dt>
<dd>value for 2</dd>
</dl>
Output:
Example:
<ol start="3">
<li>Item</li>
<li>Some Other Item</li>
<li>Yet Another Item</li>
</ol>
This will produce a numbered list (which is the default style):
3. Item
4. Some Other Item
5. Yet Another Item
Example:
<ol start="5">
<li>Item</li>
<li>Some Other Item</li>
<li value="4">A Reset Item</li>
<li>Another Item</li>
<li>Yet Another Item</li>
</ol>
OutPut:
Image Maps
An image maps is an image with clickable areas that usually act as hyperlinks.
The image is defined by the <img> tag, and the map is defined by a <map> tag with <area> tags
to denote each clickable area. Use the usemap and name attributes to bind the image and the map.
Tag/Attribute Value
<img>
Usemap The name of the map with a hash symbol prepended to it. For example, for a map
with name="map", the image should have usemap="#map".
<map>
Name The name of the map to identify it. To be used with the image's usemap attribute.
<area> Below are <area>-specific attributes. When href is specified, making the <area> a
link, <area> also supports all of the attributes of the anchor tag (<a>) except ping.
See them at the MDN docs. alt The alternate text to display if images are not
supported. This is only necessary if href is also set on
the <area>.
Cords The coordinates outlining the selectable area. When shape="polygon", this should
be set to a list of
"x, y" pairs separated by commas (i.e., shape="polygon" coords="x1, y1, x2, y2, x3,
y3, ...").
When shape="rectangle", this should be set to left, top, right, bottom. When
shape="circle", this should be set to centerX, centerY, radius.
Href The URL of the hyperlink, if specified. If it is omitted, then the <area> will not
represent a hyperlink.
Shape The shape of the <area>. Can be set to default to select the entire image (no
coords attribute
necessary), circle or circ for a circle, rectangle or rect for a rectangle, and polygon
or poly for a
polygonal area specified by corner points.
Image Formats:
There are several different image formats commonly used on the web, each with their own
advantages and disadvantages. Here are some of the most commonly used image formats and their
characteristics:
1. JPEG (Joint Photographic Experts Group): JPEG (Joint Photographic Experts Group) is a
commonly used image format for digital photographs and other complex images with many
colors and gradients. JPEG images are lossy, which means that they use compression techniques
to reduce the file size of the image by removing some of the image data that is considered less
important or noticeable to the human eye.
2. PNG (Portable Network Graphics): PNG (Portable Network Graphics) is a lossless image format
that is ideal for images with simple graphics and transparent backgrounds. PNG images use
compression techniques to reduce the file size of the image, but the compression does not result
in any loss of image quality.
Unlike JPEG images, PNG images can support transparency, meaning that parts of the image can
be made transparent so that the background behind the image can show through. This makes
PNG images useful for logos, icons, and other graphics that need to be placed on top of different
background colors or images.
PNG images can be saved in different color depths, including 8-bit (256 colors), 24-bit (true
color), and 32-bit (true color with alpha channel). The higher color depths result in larger file
sizes, but they also allow for more precise color reproduction and transparency.
3. GIF (Graphics Interchange Format): GIF (Graphics Interchange Format) is a type of image
format that supports animations and a limited color palette of up to 256 colors. GIF images are
made up of multiple frames that are displayed in sequence, giving the illusion of movement or
animation.
4. SVG (Scalable Vector Graphics): SVG (Scalable Vector Graphics) is an image format that is based
on XML (Extensible Markup Language) and is used for creating vector images that can be scaled
The development of websites and web pages typically involves several steps and can be divided into
two main categories:
front-end development and
back-end development.
1. Front-end development refers to the process of creating the user interface and design of a
website or web page. This involves writing HTML, CSS, and JavaScript code to create the
structure, layout, and functionality of the website, as well as any visual and interactive
elements such as buttons, forms, and animations. Front-end developers also ensure that the
website is responsive and mobile-friendly, meaning it can adjust to different screen sizes and
devices.
2. Back-end development, on the other hand, involves the creation of the server-side code
and database management that powers the website or web application. This can involve using
programming languages such as PHP, Python, or Ruby, and frameworks such as Laravel or
Django, to create and manage dynamic content such as user accounts, forms, and data
processing. Back-end developers also ensure that the website is secure and scalable, meaning
it can handle large amounts of traffic and data.
The development process typically involves several stages, including planning and research, design
and prototyping, coding and development, testing and debugging, and deployment and
maintenance. Throughout each stage, developers work closely with designers, content creators, and
other stakeholders to ensure that the website meets the project requirements and user needs.
In recent years, there has been a trend towards using content management systems (CMS) such as
WordPress or Drupal, which provide pre-built templates and modules that can simplify and speed
up the development process. These systems also allow non-technical users to easily update and
manage the content of the website.
Website navigation refers to the way users move through a website or web application to access its
various pages, sections, and features. Effective website navigation is essential for providing a good user
experience and ensuring that users can easily find the information they need. The following are some
common techniques and best practices for website navigation:
1. Clear and consistent labeling: Navigation links should be clearly labeled and easy to
understand. Use standard conventions for navigation labels, such as "Home", "About", "Contact",
and "Services". Avoid using jargon or obscure terms that users may not understand.
2. Simple and intuitive layout: The navigation layout should be simple and easy to understand.
Avoid cluttering the navigation menu with too many options, and group related pages or
sections together. Use visual cues such as icons or drop-down menus to help users quickly find
what they are looking for.
3. Responsive design: Ensure that the navigation menu is accessible and easy to use on all devices,
including desktops, laptops, tablets, and smartphones. Use responsive design techniques to
adjust the navigation layout and functionality based on the user's screen size and device.
4. Search functionality: Include a search box on the website to allow users to search for specific
information or pages. Make sure the search box is easily visible and accessible from any page
on the website.
When structuring a website, it's important to consider the user experience and ensure that the website
is easy to navigate and understand. This can involve organizing content into categories, using clear and
descriptive labels for links and buttons, and providing a clear hierarchy of information.
Design and layout are also important considerations when structuring a website. The design should be
visually appealing and consistent with the brand identity, while the layout should be intuitive and easy
to navigate.
Finally, it's important to ensure that the website is optimized for different devices and screen sizes, as
more and more people are accessing the internet from mobile devices. This can involve using
responsive design techniques to ensure that the website adapts to different screen sizes and
orientations.