Unit 01 - Full Stack Web Development
Unit 01 - Full Stack Web Development
Development
by Dr Piyush Bagla
Why HTML 5.0 ?
ARPANET
HTML 5.0
- The Internet is a global network of interconnected
computer networks that communicate using
standardized protocols.
SGML
- SGML allows users to define the hierarchical structure of
documents, specify elements and attributes, and establish
relationships between different parts of the document. SGML-
aware software can then process these documents to extract,
manipulate, or present the information contained within them.
SGML Application Areas
In the publishing industry, SGML has been used to define the structure
of technical documentation, such as user manuals for complex
machinery or equipment.
WHATWG The web was evolving toward dynamic applications, and W3C wasn’t
keeping up.
INTERNET = THE HIGHWAY WWW = THE SHOPPING HTML = THE BLUEPRINT OF BROWSER = YOUR CAR
SYSTEM MALL EACH SHOP (HOW YOU ACCESS
(CONNECTS EVERYTHING) (WEBSITES YOU VISIT) (STRUCTURE OF WEB PAGES) WEBSITES)
HTML 5.0 Predecessors
+--------------+--------------------------------+----------------+----------------------------------------+
| HTML Version | Development Body | Year Published
+--------------+--------------------------------+----------------+----------------------------------------+
• | HTML 1.0 | Tim Berners-Lee at CERN | 1991
• | HTML 2.0 | Internet Engineering Task Force | 1995
• | HTML 3.2 | W3C | 1997
• | HTML 4.01 | W3C | 1999
• | XHTML | W3C | 2000
• | HTML5 | W3C (initially) & WHATWG (main) | 2014
• | HTML Living Standard | WHATWG | 2017
• +--------------+--------------------------------+----------------+----------------------------------------+
Comparison of HTML 5 Elements with previous versions
Limited semantic elements (<div>, <span>, Rich set of semantic elements (<header>,
Structural Elements
<table>, etc.) <nav>, <section>, <footer>, etc.)
Rely on third-party plugins like Flash or Native support for embedding video and
Video and Audio
Silverlight audio content
• A semantic element clearly describes its meaning to both the browser and the
developer.
• They are also called structural elements.
• In HTML, there are some semantic elements that can be used to define different
parts of a web page.
• Examples of semantic elements: <form>, <table>, and <article> - Clearly define its
content.
<section> is used for grouping related content, while <article> is used for stand-alone, independent content
items that can be syndicated or shared separately.
Semantic Elements in HTML
.
.
.
.
.
Notes: External images might be under copyright. If you do not get permission to use it, you may be in
violation of copyright laws. In addition, you cannot control external images; it can suddenly be removed or
changed.
• 2. Relative URL - Links to an image that is hosted within the website. Here, the URL does not include the
domain name.
• If the URL begins without a slash, it will be relative to the current page.
• Example: src="img_girl.jpg".
• If the URL begins with a slash, it will be relative to the domain.
• Example: src="/images/img_girl.jpg".
Tip: It is almost always best to use relative URLs. They will not break if you change the domain.
•
HTML Images and Icon
Image
• Basic tag and attributes
• Image Map
• The Picture Element
Icon
Step 1 – Copy the style link from any website (which provides this functionality) inside the head section
Example - Font Awesome CDN
Step 2 – Copy the desired icon link inside the body section
<i class="fa fa-home"></i>
Example – Font Awesome Icon
HTML Images and Icon
Image Map
An image map is an image with clickable areas.
<map name="workmap">
<area shape="rect" coords="34,44,270,350" alt="
Computer" href="computer.htm">
<area shape="rect" coords="290,172,333,250" alt
="Phone" href="phone.htm">
<area shape="circle" coords="337,300,44" alt="C
offee" href="coffee.htm">
</map>
credit w3schools
The coordinates 34,44 is located 34 pixels The coordinates 270,350 is located 270
from the left margin and 44 pixels from the pixels from the left margin and 350 pixels
top from the top
credit w3schools
The coordinates 34,44 is located 34 pixels The coordinates 270,350 is located 270
from the left margin and 44 pixels from the pixels from the left margin and 350 pixels
top from the top
credit w3schools
HTML Images and Icon
Image Map
<picture>
<source media="(min-width:
650px)" srcset="img_food.jpg">
<source media="(min-width:
465px)" srcset="img_car.jpg">
<img src="img_girl.jpg">
</picture>
HTML List
• Unordered
• type
• circle Unordered Ordered Description
• Square
• Disc
• none
• Ordered
• type
• 1,2,3
• a,b,c
• A,B, C
• i, ii, iii
• I, II, III,
• Description
• Nested List
HTML Table
HTML Table
HTML Table
iFrame in HTML
HTML element used to embed another document within the current HTML document. It allows you to display
content from another source, such as a web page, PDF document, video, or interactive application, within the
context of your own web page.
• A block-level element always starts on a
new line, and the browsers automatically
add some space (a margin) before and
after the element.
• A block-level element always takes up
the full width available (stretches out to
the left and right as far as it can)
Block level and
Inline elements
Eg. <p>, <div>, <ul>, <form> etc
GET:
•Appends the form data to the URL in name/value pairs
•NEVER use GET to send sensitive data! (the submitted form data is visible in the URL!)
•The length of a URL is limited (2048 characters)
•Useful for form submissions where a user wants to bookmark the result
•GET is good for non-secure data, like query strings in Google
POST:
•Appends the form data inside the body of the HTTP request (the submitted form data is not
shown in the URL)
•POST has no size limitations and can be used to send large amounts of data.
•Form submissions with POST cannot be bookmarked.
Accessibility in HTML5
Accessibility in HTML5 refers to the practice of designing and coding web content in a way
that ensures it is accessible (a good way to navigate and interact) to all users, including those
with disabilities.
A valid Web page is not necessarily a good web page, but an invalid Web
page has little chance of being a good web page.
https://validator.w3.org
The W3C CSS Validation Service
Note: If you want to validate your CSS style sheet embedded in an (X)HTML document,
you should first check that the (X)HTML you use is valid.
https://jigsaw.w3.org/css-validator/
HTML | CSS | Javascript
p
{
color: blue;
}
Types of CSS or Ways to Insert CSS
•External CSS
•Internal CSS
•Inline CSS
Inline CSS
Internal CSS
External CSS
HTML and CSS Comments
HTML
<!-- These paragraphs will be red -->
CSS
/*These paragraphs will be red */
CSS Selectors
CSS selectors are used to select the HTML elements you want to style.
p { p,h1 {
text-align: center; text-align: center;
color: red; color: red;
} }
• The HTML class attribute specifies one or more class names for an element
• Classes are used by CSS and JavaScript to select and access specific elements
• The class attribute can be used on any HTML element
• The class name is case-sensitive
• Different HTML elements can point to the same class name
• JavaScript can access elements with a specific class name with
the getElementsByClassName() method
Universal selector
* {
text-align: center;
color: blue;
}
2. Combinator selectors
•Descendant Combinator(space)
•Child Combinator(>)
•Subsequent-sibling Combinator(~)
3. Pseudo-class selectors
/* unvisited link */
Syntax a:link { div:hover p {
color: #FF0000; display: block;
selector:pseudo-class { } }
property: value;
} /* visited link */
a:visited {
color: #00FF00;
}
4. Pseudo-element selectors
It is possible to style HTML elements that have specific attributes or attribute values.
a[target] { a[target="_blank"] {
background-color: yellow; background-color: yellow;
} }
CSS Colors
There are four common ways to apply colors
1. Direct Color Name
<h1 style="color:Red;">Hello World</h1>
3. HEX
#RRGGBB, #ff6678
Note: When you set the width and height properties of an element with CSS, you just set the
width and height of the content area.
• To calculate the total width and height of an element, you must also include the padding
and borders.
Note: The margin property also affects the total space that the box will take up on the page,
but the margin is not included in the actual size of the box. The box's total width and height
stops at the border.
CSS Fonts
The shorthand font property, combines several font-related properties into one. The order of
the values in the shorthand font property is as follows:
Note: The font-size and font-family values are required. If one of the other values is
missing, their default value are used.
Bootstrap
• Bootstrap is a free front-end framework for faster and easier web development.
• Bootstrap includes HTML and CSS based design templates for typography, forms,
buttons, tables, navigation, modals, image carousels and many other, as well as
optional JavaScript plugins.
• Bootstrap also gives you the ability to easily create responsive designs.
Bootstrap Versions
• Bootstrap 5 (released 2021) is the newest version with new components, faster
stylesheet and more responsiveness. However, Internet Explorer 11 and down is not
supported.
There are two ways to start using Bootstrap 5 on your own website.
• Many users already have downloaded Bootstrap 5 from jsDelivr when visiting another
site. As a result, it will be loaded from cache when they visit your site, which leads to
faster loading time.
• Also, most CDN's will make sure that once a user requests a file from it, it will be
served from the server closest to them, which also leads to faster loading time.
Bootstrap 5 Containers
Containers are used to pad the content inside of them, and there are two container
classes available: