SlideShare a Scribd company logo
RESPONSIVE WEB DESIGN
WITH
HTML5 & CSS3
ADVANCED WEB TECHNOLOGY
MODULE 2
DIVYA TIWARI
MEIT
TERNA ENGINEERING COLLEGE
INDEX
• Introduction to CSS
1. Evolution of CSS
2. Syntax of CSS
3. Exploring CSS Selectors
4. Inserting CSS in an HTML Documents
5. Defining Inheritance in CSS
• CSS3 and Responsive Web Design
1. CSS3: Selectors, Typography and Color
Modes
2. Stunning Aesthetics with CSS3
3. CSS3 Transitions, Transformations and
Animations
Evolution of CSS
• CSS was introduced in late 1996 on the recommendation of World Wide Web
Consortium (W3C).
• The CSS level 1 (CSS 1) Recommendation was published in December, 1996.
• The W3C group worked on the issues that were not addressed in CSS 1. It gave
rise to the creation of higher version of CSS 1 namely CSS level 2 (CSS 2) on
November 4, 1997.
• CSS 2 was published as a W3C Recommendation on May 12, 1998. Some CSS 2
properties that could not be successfully implemented by the Web browsers were
discarded from CSS 2.
• Later, CSS 2.1 became a Candidate Recommendation on February 25, 2004, but
was pulled back to Working Draft status on June 13, 2005, and again returned to
Candidate Recommendation status on July 19, 2007.
Syntax of CSS
• Syntax can be defined as a rule that defines the structure or the order of the
statements used in a programming language.
• It also specifies how words and symbols are put together to form statements and
expressions.
• CSS also uses syntax to apply CSS rules in an HTML document. The CSS syntax
is divided into two different parts—selector and declaration.
• Selector defines an HTML element to which the CSS style is applied and the
declaration contains the CSS properties as well as the value of these properties.
Exploring CSS Selectors
• A selector is a pattern that is used to select an element to apply the CSS style rules.
• Selectors can be used as a condition or a CSS rule to determine the elements that
match with the selector.
• The CSS rule is divided into two parts: selectors and declaration.
• The different types of selectors are as follows:
a) The universal selector
b) The type selector
c) The class selector
d) The id selector
e) The child selector
f) The descendant selector
g) The adjacent sibling selector
h) The attribute selector
i) The query selector
Inserting CSS in an HTML Documents
• A CSS style sheet can be linked to an HTML document in a variety of ways,
where each way has its own advantages and disadvantages.
• The following are three ways to apply CSS style to your HTML document:
• The internal style sheet
• The external style sheet
• The in-line style
• The Internal Style Sheet
The internal style sheet is written within the HEAD element of the HTML
document. This style is applied only to the documents in which it is defined
and not referenced by any other Web document.
<STYLE type="text/css">
selector {property: value;}
</STYLE>
• The External Style Sheet
• The syntax to create an external style sheet is same as that of creating an internal
style sheet.
• In case of internal style sheet, the CSS file is placed inside the HTML document;
whereas, in case of external style sheet, the CSS file is written outside the HTML
document and the reference of the CSS file is placed in the HTML document.
• Linking—Refers to the HTML LINK element, which is used to link a style sheet. This
element has three attributes— rel, type, and href. The rel attribute specifies what you are
linking (style sheet in this case). The type specifies the MIME type for the browser, and
the href attribute specifies the path of the .css file.
<LINK rel=”style sheet” type=”text/css” href=”test.css”/>
• Importing—Helps you in accessing the style rules from other CSS style sheets. The
@import keyword is used, followed by the Uniform Resource Identifier (URI) of the
style sheet to which you want to import the style rules.
<STYLE TYPE="text/css">
@media screen
{ body {font-size: 13px} }
</STYLE>
• The Inline style
• The inline style properties are written in a single line separated by semicolons. These
properties are placed inside the style attribute of the HTML element, on which you want
to apply the style:
<P style="background:#ccc; color:#fff; border: solid black 1px;">
Defining Inheritance in CSS
• In CSS, a property that is applied to an element is also inherited by the child
elements of that element.
• For example, if the font-family property is declared for the BODY element, it is
automatically applied to all the elements present inside the BODY element.
• This inheritance saves your time in writing the repeated code for every single
element that constitutes the Web page.
• The following code snippet shows inheritance in CSS:
<DIV style="font-family:serif; border:1px solid red; padding:10px;">
This text will be in a serif font.
<P>
This text is also in a serif font, because font is inherited by default. But the border and
padding properties are not inherited from the parent div.
</P>
</DIV>
CSS3: Selectors, Typography and Color
Modes
• CSS3 has Supported additional color properties as follows −
• RGBA colors (Red Green Blue Alpha)
• HSL colors (hue, saturation, lightness)
• HSLA colors (hue, saturation, lightness and alpha)
• Opacity
RGBA colors (Red Green Blue Alpha)
• It is an extension of CSS2, Alpha specifies the opacity of a color and parameter number
is a numerical between 0.0 to 1.0.
• A Sample syntax of RGBA as shown below −
#d1 {background-color: rgba(255, 0, 0, 0.5);}
#d2 {background-color: rgba(0, 255, 0, 0.5);}
#d3 {background-color: rgba(0, 0, 255, 0.5);}
Output
HSL colors (hue, saturation, lightness)
• HSL stands for hue, saturation, lightness.
• Here Hue is a degree on the color wheel, saturation and lightness are percentage values
between 0 to 100%.
• A Sample syntax of HSL as shown below −
#g1 {background-color: hsl(120, 100%, 50%);}
#g2 {background-color: hsl(120, 100%, 75%);}
#g3 {background-color: hsl(120, 100%, 25%);}
Output
Code –
<!DOCTYPE html>
<html>
<head>
<style>
#g1 {background-color:hsl(120,100%,50%);}
#g2 {background-color:hsl(120,100%,75%);}
#g3 {background-color:hsl(120,100%,25%);}
</style>
</head>
<body>
<p>HSL colors:</p>
<p id="g1">Green</p>
<p id="g2">Normal Green</p>
<p id="g3">Dark Green</p>
</body>
</html>
HSLA colors (hue, saturation, lightness and alpha)
• HSLA stands for hue, saturation, lightness and alpha.
• Alpha value specifies the opacity as shown RGBA.
• A Sample syntax of HSLA as shown below −
#g1 {background-color: hsla(120, 100%, 50%, 0.3);}
#g2 {background-color: hsla(120, 100%, 75%, 0.3);}
#g3 {background-color: hsla(120, 100%, 25%, 0.3);}
Output
Code –
<!DOCTYPE html>
<html>
<head>
<style>
#d1 {background-color:hsla(120,100%,50%,0.3);}
#d2 {background-color:hsla(120,100%,75%,0.3);}
#d3 {background-color:hsla(120,100%,25%,0.3);}
</style>
</head>
<body>
<p>HSLA colors:</p>
<p id="d1">Less opacity green</p>
<p id="d2">Green</p>
<p id="d3">Green</p>
</body>
</html>
Stunning Aesthetics with CSS3
• Creating text shadows with CSS3
• Creating box shadows with CSS3
• Gradient backgrounds with CSS3
Creating text shadows with CSS3
• The CSS text-shadow property applies shadow to text.
• In its simplest use, you only specify the horizontal shadow (2px) and the vertical shadow
(3px):
• Adding a blur effect to the shadow
• Adding color to the shadow
Syntax :
.element { text-shadow: 2px 3px 1px #ccc; }
Output
Code –
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
text-shadow: 2px 2px 5px red;
}
</style>
</head>
<body>
<h1>Text-shadow effect!</h1>
</body>
</html>
Text-shadow effect!
Creating box shadows with CSS3
• The CSS box-shadow property applies shadow to elements.
Syntax :
.shadow { box-shadow: 0px 3px 5px #444; }
Output
Code –
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 300px;
height: 100px;
padding: 15px;
background-color: yellow;
box-shadow: 10px 10px 5px grey;
}
</style>
</head>
<body>
<div>This is a div element with a box-
shadow</div>
</body>
</html>
Gradient backgrounds with CSS3
• CSS gradients let you display smooth transitions between two or more specified colors.
• CSS defines two types of gradients:
• Linear Gradients (goes down/up/left/right/diagonally)
• Radial Gradients (defined by their center)
Syntax
background: linear-gradient(direction, color-stop1, color-stop2, ...);
background: linear-gradient(angle, color-stop1, color-stop2);
background: radial-gradient(shape size at position, start-color, ..., last-color);
 The angle is specified as an angle between a horizontal line and the gradient line.
 The shape parameter defines the shape. It can take the value circle or ellipse. The
default value is ellipse.
Example :-
Code –
<!DOCTYPE html>
<html>
<head>
<style>
#grad1 {
height: 100px;
background: red; /* For browsers that do not support gradients */
background: linear-gradient(to right, red , yellow); /* Standard syntax (must be last) */
}
#grad2 {
height: 100px;
background: red; /* For browsers that do not support gradients */
background: linear-gradient(-90deg, red, yellow); /* Standard syntax (must be last) */
}
#grad3 {
height: 150px;
width: 200px;
background: red; /* For browsers that do not support gradients */
background: radial-gradient(circle, red, yellow, green); /* Standard syntax (must be last) */
}
#grad4 {
height: 200px;
background: red; /* For browsers that do not support gradients */
background: repeating-linear-gradient(90deg,red,yellow 7%,green 10%); /* Standard syntax
(must be last) */
}
</style>
</head>
<body>
<h1>Linear Gradient - Left to Right</h1>
<div id="grad1"></div>
<h1>Linear Gradient - Left to Right with angle</h1>
<div id="grad2" style="text-align:center;">-90deg</div><br>
<h1>Radial Gradient - Shapes</h1>
<div id="grad3"></div>
<h1>A repeating gradient on 90deg starting red and finishing green:</h1>
<div id="grad4"></div>
</body>
</html>
Output
CSS3 Transitions, Transformations and
Animations
• CSS3 transitions allows to change property values smoothly, over a given duration.
• Properties of Transitions are:
• Transition
• Transition-delay
• Transition-duration
• Transition-property
• Transition-timing-function
Output
• CSS3 Transformation provides following transformation methods:
• Translate()
• Rotate()
• scaleX()
• scaleY()
• scale()
• skewX()
• skewY()
• skew()
• matrix()
Output
• CSS3 allows animation of HTML elements without using JavaScript or Flash.
• Properties of Animations are:
• @keyframes
• animation-name
• animation-duration
• animation-delay
• animation-iteration-count
• animation-direction
• animation-timing-function
• animation-fill-mode
Output
MU Exam Questions
May 2017
• Explain how to design a responsive web with HTML5 and CSS. 10 marks
Dec 2018
• Explain in detail Responsive web design with an example. 10 marks
• What are major differences between CSS3 and CSS2. 10 marks
May 2019
• Explain in detail Responsive web design using HTML5 and CSS3 with an example.
10 marks
• Create a web page to show how you can apply the transformation effects so that the image
rotates by 150 degree. Assume suitable parameters if required. 10 marks
Responsive web design with html5 and css3
Ad

More Related Content

What's hot (20)

CSS
CSSCSS
CSS
Raja Kumar Ranjan
 
CSS
CSSCSS
CSS
seedinteractive
 
html-css
html-csshtml-css
html-css
Dhirendra Chauhan
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
Webtech Learning
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
Ana Cidre
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation
joilrahat
 
Css lecture notes
Css lecture notesCss lecture notes
Css lecture notes
Santhiya Grace
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid Layout
Rachel Andrew
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
Reshmi Rajan
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Marc Steel
 
Introducing CSS Grid
Introducing CSS GridIntroducing CSS Grid
Introducing CSS Grid
Jason Yingling
 
Css Display Property
Css Display PropertyCss Display Property
Css Display Property
Webtech Learning
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
Fahim Abdullah
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
tutorialsruby
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
abhilashagupta
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Folasade Adedeji
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
Zoe Gillenwater
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
Sanjeev Kumar
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
Michael Jhon
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
Webtech Learning
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
Ana Cidre
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation
joilrahat
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid Layout
Rachel Andrew
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
Reshmi Rajan
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Marc Steel
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
Fahim Abdullah
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
abhilashagupta
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
Zoe Gillenwater
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
Michael Jhon
 

Similar to Responsive web design with html5 and css3 (20)

Css
CssCss
Css
Abhishek Kesharwani
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
Abhishek Kesharwani
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptx
karthiksmart21
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
JebaRaj26
 
4. Web Technology CSS Basics-1
4. Web Technology CSS Basics-14. Web Technology CSS Basics-1
4. Web Technology CSS Basics-1
Jyoti Yadav
 
2 introduction css
2 introduction css2 introduction css
2 introduction css
Jalpesh Vasa
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptx
alvindalejoyosa1
 
Week11 Lecture: CSS
Week11 Lecture: CSSWeek11 Lecture: CSS
Week11 Lecture: CSS
Katherine McCurdy-Lapierre, R.G.D.
 
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxUnit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptx
Tanu524249
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
Salman Memon
 
CSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.ECSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.E
NavyaEnugala
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
smitha273566
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
MattMarino13
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
smithaps4
 
cascadingstylesheets,introduction.css styles-210909054722.pptx
cascadingstylesheets,introduction.css styles-210909054722.pptxcascadingstylesheets,introduction.css styles-210909054722.pptx
cascadingstylesheets,introduction.css styles-210909054722.pptx
hannahroseline2
 
Kick start @ css
Kick start @ cssKick start @ css
Kick start @ css
Umesh Agarwal
 
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
Casecading Style Sheets for Hyper Text Transfer Protocol.pptxCasecading Style Sheets for Hyper Text Transfer Protocol.pptx
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
usmanahmadawan
 
CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)
Saurabh Anand
 
cascading style sheets- About cascading style sheets on the selectors
cascading style sheets- About cascading style sheets on the selectorscascading style sheets- About cascading style sheets on the selectors
cascading style sheets- About cascading style sheets on the selectors
JayanthiM19
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
MattMarino13
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptx
karthiksmart21
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
JebaRaj26
 
4. Web Technology CSS Basics-1
4. Web Technology CSS Basics-14. Web Technology CSS Basics-1
4. Web Technology CSS Basics-1
Jyoti Yadav
 
2 introduction css
2 introduction css2 introduction css
2 introduction css
Jalpesh Vasa
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptx
alvindalejoyosa1
 
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxUnit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptx
Tanu524249
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
Salman Memon
 
CSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.ECSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.E
NavyaEnugala
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
smitha273566
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
MattMarino13
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
smithaps4
 
cascadingstylesheets,introduction.css styles-210909054722.pptx
cascadingstylesheets,introduction.css styles-210909054722.pptxcascadingstylesheets,introduction.css styles-210909054722.pptx
cascadingstylesheets,introduction.css styles-210909054722.pptx
hannahroseline2
 
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
Casecading Style Sheets for Hyper Text Transfer Protocol.pptxCasecading Style Sheets for Hyper Text Transfer Protocol.pptx
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
usmanahmadawan
 
CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)
Saurabh Anand
 
cascading style sheets- About cascading style sheets on the selectors
cascading style sheets- About cascading style sheets on the selectorscascading style sheets- About cascading style sheets on the selectors
cascading style sheets- About cascading style sheets on the selectors
JayanthiM19
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
MattMarino13
 
Ad

More from Divya Tiwari (13)

Digital stick by Divya & Kanti
Digital stick by Divya & KantiDigital stick by Divya & Kanti
Digital stick by Divya & Kanti
Divya Tiwari
 
Predicting house price
Predicting house pricePredicting house price
Predicting house price
Divya Tiwari
 
Testing strategies -2
Testing strategies -2Testing strategies -2
Testing strategies -2
Divya Tiwari
 
Testing strategies part -1
Testing strategies part -1Testing strategies part -1
Testing strategies part -1
Divya Tiwari
 
Performance measures
Performance measuresPerformance measures
Performance measures
Divya Tiwari
 
Programming using MPI and OpenMP
Programming using MPI and OpenMPProgramming using MPI and OpenMP
Programming using MPI and OpenMP
Divya Tiwari
 
IoT applications and use cases part-2
IoT applications and use cases part-2IoT applications and use cases part-2
IoT applications and use cases part-2
Divya Tiwari
 
Io t applications and use cases part-1
Io t applications and use cases part-1Io t applications and use cases part-1
Io t applications and use cases part-1
Divya Tiwari
 
Planning for security and security audit process
Planning for security and security audit processPlanning for security and security audit process
Planning for security and security audit process
Divya Tiwari
 
Security management concepts and principles
Security management concepts and principlesSecurity management concepts and principles
Security management concepts and principles
Divya Tiwari
 
Web services
Web servicesWeb services
Web services
Divya Tiwari
 
Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks
Divya Tiwari
 
Routing protocols for ad hoc wireless networks
Routing protocols for ad hoc wireless networks Routing protocols for ad hoc wireless networks
Routing protocols for ad hoc wireless networks
Divya Tiwari
 
Digital stick by Divya & Kanti
Digital stick by Divya & KantiDigital stick by Divya & Kanti
Digital stick by Divya & Kanti
Divya Tiwari
 
Predicting house price
Predicting house pricePredicting house price
Predicting house price
Divya Tiwari
 
Testing strategies -2
Testing strategies -2Testing strategies -2
Testing strategies -2
Divya Tiwari
 
Testing strategies part -1
Testing strategies part -1Testing strategies part -1
Testing strategies part -1
Divya Tiwari
 
Performance measures
Performance measuresPerformance measures
Performance measures
Divya Tiwari
 
Programming using MPI and OpenMP
Programming using MPI and OpenMPProgramming using MPI and OpenMP
Programming using MPI and OpenMP
Divya Tiwari
 
IoT applications and use cases part-2
IoT applications and use cases part-2IoT applications and use cases part-2
IoT applications and use cases part-2
Divya Tiwari
 
Io t applications and use cases part-1
Io t applications and use cases part-1Io t applications and use cases part-1
Io t applications and use cases part-1
Divya Tiwari
 
Planning for security and security audit process
Planning for security and security audit processPlanning for security and security audit process
Planning for security and security audit process
Divya Tiwari
 
Security management concepts and principles
Security management concepts and principlesSecurity management concepts and principles
Security management concepts and principles
Divya Tiwari
 
Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks
Divya Tiwari
 
Routing protocols for ad hoc wireless networks
Routing protocols for ad hoc wireless networks Routing protocols for ad hoc wireless networks
Routing protocols for ad hoc wireless networks
Divya Tiwari
 
Ad

Recently uploaded (20)

Interfacing PMW3901 Optical Flow Sensor with ESP32
Interfacing PMW3901 Optical Flow Sensor with ESP32Interfacing PMW3901 Optical Flow Sensor with ESP32
Interfacing PMW3901 Optical Flow Sensor with ESP32
CircuitDigest
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Journal of Soft Computing in Civil Engineering
 
How to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdfHow to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdf
jamedlimmk
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
Parameter-Efficient Fine-Tuning (PEFT) techniques across language, vision, ge...
Parameter-Efficient Fine-Tuning (PEFT) techniques across language, vision, ge...Parameter-Efficient Fine-Tuning (PEFT) techniques across language, vision, ge...
Parameter-Efficient Fine-Tuning (PEFT) techniques across language, vision, ge...
roshinijoga
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Surveying through global positioning system
Surveying through global positioning systemSurveying through global positioning system
Surveying through global positioning system
opneptune5
 
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdfPRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Guru
 
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
Taqyea
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
Building-Services-Introduction-Notes.pdf
Building-Services-Introduction-Notes.pdfBuilding-Services-Introduction-Notes.pdf
Building-Services-Introduction-Notes.pdf
Lawrence Omai
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Interfacing PMW3901 Optical Flow Sensor with ESP32
Interfacing PMW3901 Optical Flow Sensor with ESP32Interfacing PMW3901 Optical Flow Sensor with ESP32
Interfacing PMW3901 Optical Flow Sensor with ESP32
CircuitDigest
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
How to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdfHow to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdf
jamedlimmk
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Parameter-Efficient Fine-Tuning (PEFT) techniques across language, vision, ge...
Parameter-Efficient Fine-Tuning (PEFT) techniques across language, vision, ge...Parameter-Efficient Fine-Tuning (PEFT) techniques across language, vision, ge...
Parameter-Efficient Fine-Tuning (PEFT) techniques across language, vision, ge...
roshinijoga
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Surveying through global positioning system
Surveying through global positioning systemSurveying through global positioning system
Surveying through global positioning system
opneptune5
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdfPRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Guru
 
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
Taqyea
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
Building-Services-Introduction-Notes.pdf
Building-Services-Introduction-Notes.pdfBuilding-Services-Introduction-Notes.pdf
Building-Services-Introduction-Notes.pdf
Lawrence Omai
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 

Responsive web design with html5 and css3

  • 1. RESPONSIVE WEB DESIGN WITH HTML5 & CSS3 ADVANCED WEB TECHNOLOGY MODULE 2 DIVYA TIWARI MEIT TERNA ENGINEERING COLLEGE
  • 2. INDEX • Introduction to CSS 1. Evolution of CSS 2. Syntax of CSS 3. Exploring CSS Selectors 4. Inserting CSS in an HTML Documents 5. Defining Inheritance in CSS • CSS3 and Responsive Web Design 1. CSS3: Selectors, Typography and Color Modes 2. Stunning Aesthetics with CSS3 3. CSS3 Transitions, Transformations and Animations
  • 3. Evolution of CSS • CSS was introduced in late 1996 on the recommendation of World Wide Web Consortium (W3C). • The CSS level 1 (CSS 1) Recommendation was published in December, 1996. • The W3C group worked on the issues that were not addressed in CSS 1. It gave rise to the creation of higher version of CSS 1 namely CSS level 2 (CSS 2) on November 4, 1997. • CSS 2 was published as a W3C Recommendation on May 12, 1998. Some CSS 2 properties that could not be successfully implemented by the Web browsers were discarded from CSS 2. • Later, CSS 2.1 became a Candidate Recommendation on February 25, 2004, but was pulled back to Working Draft status on June 13, 2005, and again returned to Candidate Recommendation status on July 19, 2007.
  • 4. Syntax of CSS • Syntax can be defined as a rule that defines the structure or the order of the statements used in a programming language. • It also specifies how words and symbols are put together to form statements and expressions. • CSS also uses syntax to apply CSS rules in an HTML document. The CSS syntax is divided into two different parts—selector and declaration. • Selector defines an HTML element to which the CSS style is applied and the declaration contains the CSS properties as well as the value of these properties.
  • 5. Exploring CSS Selectors • A selector is a pattern that is used to select an element to apply the CSS style rules. • Selectors can be used as a condition or a CSS rule to determine the elements that match with the selector. • The CSS rule is divided into two parts: selectors and declaration. • The different types of selectors are as follows: a) The universal selector b) The type selector c) The class selector d) The id selector e) The child selector f) The descendant selector g) The adjacent sibling selector h) The attribute selector i) The query selector
  • 6. Inserting CSS in an HTML Documents • A CSS style sheet can be linked to an HTML document in a variety of ways, where each way has its own advantages and disadvantages. • The following are three ways to apply CSS style to your HTML document: • The internal style sheet • The external style sheet • The in-line style • The Internal Style Sheet The internal style sheet is written within the HEAD element of the HTML document. This style is applied only to the documents in which it is defined and not referenced by any other Web document. <STYLE type="text/css"> selector {property: value;} </STYLE>
  • 7. • The External Style Sheet • The syntax to create an external style sheet is same as that of creating an internal style sheet. • In case of internal style sheet, the CSS file is placed inside the HTML document; whereas, in case of external style sheet, the CSS file is written outside the HTML document and the reference of the CSS file is placed in the HTML document. • Linking—Refers to the HTML LINK element, which is used to link a style sheet. This element has three attributes— rel, type, and href. The rel attribute specifies what you are linking (style sheet in this case). The type specifies the MIME type for the browser, and the href attribute specifies the path of the .css file. <LINK rel=”style sheet” type=”text/css” href=”test.css”/> • Importing—Helps you in accessing the style rules from other CSS style sheets. The @import keyword is used, followed by the Uniform Resource Identifier (URI) of the style sheet to which you want to import the style rules. <STYLE TYPE="text/css"> @media screen { body {font-size: 13px} } </STYLE>
  • 8. • The Inline style • The inline style properties are written in a single line separated by semicolons. These properties are placed inside the style attribute of the HTML element, on which you want to apply the style: <P style="background:#ccc; color:#fff; border: solid black 1px;">
  • 9. Defining Inheritance in CSS • In CSS, a property that is applied to an element is also inherited by the child elements of that element. • For example, if the font-family property is declared for the BODY element, it is automatically applied to all the elements present inside the BODY element. • This inheritance saves your time in writing the repeated code for every single element that constitutes the Web page. • The following code snippet shows inheritance in CSS: <DIV style="font-family:serif; border:1px solid red; padding:10px;"> This text will be in a serif font. <P> This text is also in a serif font, because font is inherited by default. But the border and padding properties are not inherited from the parent div. </P> </DIV>
  • 10. CSS3: Selectors, Typography and Color Modes • CSS3 has Supported additional color properties as follows − • RGBA colors (Red Green Blue Alpha) • HSL colors (hue, saturation, lightness) • HSLA colors (hue, saturation, lightness and alpha) • Opacity RGBA colors (Red Green Blue Alpha) • It is an extension of CSS2, Alpha specifies the opacity of a color and parameter number is a numerical between 0.0 to 1.0. • A Sample syntax of RGBA as shown below − #d1 {background-color: rgba(255, 0, 0, 0.5);} #d2 {background-color: rgba(0, 255, 0, 0.5);} #d3 {background-color: rgba(0, 0, 255, 0.5);} Output
  • 11. HSL colors (hue, saturation, lightness) • HSL stands for hue, saturation, lightness. • Here Hue is a degree on the color wheel, saturation and lightness are percentage values between 0 to 100%. • A Sample syntax of HSL as shown below − #g1 {background-color: hsl(120, 100%, 50%);} #g2 {background-color: hsl(120, 100%, 75%);} #g3 {background-color: hsl(120, 100%, 25%);} Output Code – <!DOCTYPE html> <html> <head> <style> #g1 {background-color:hsl(120,100%,50%);} #g2 {background-color:hsl(120,100%,75%);} #g3 {background-color:hsl(120,100%,25%);} </style> </head> <body> <p>HSL colors:</p> <p id="g1">Green</p> <p id="g2">Normal Green</p> <p id="g3">Dark Green</p> </body> </html>
  • 12. HSLA colors (hue, saturation, lightness and alpha) • HSLA stands for hue, saturation, lightness and alpha. • Alpha value specifies the opacity as shown RGBA. • A Sample syntax of HSLA as shown below − #g1 {background-color: hsla(120, 100%, 50%, 0.3);} #g2 {background-color: hsla(120, 100%, 75%, 0.3);} #g3 {background-color: hsla(120, 100%, 25%, 0.3);} Output Code – <!DOCTYPE html> <html> <head> <style> #d1 {background-color:hsla(120,100%,50%,0.3);} #d2 {background-color:hsla(120,100%,75%,0.3);} #d3 {background-color:hsla(120,100%,25%,0.3);} </style> </head> <body> <p>HSLA colors:</p> <p id="d1">Less opacity green</p> <p id="d2">Green</p> <p id="d3">Green</p> </body> </html>
  • 13. Stunning Aesthetics with CSS3 • Creating text shadows with CSS3 • Creating box shadows with CSS3 • Gradient backgrounds with CSS3
  • 14. Creating text shadows with CSS3 • The CSS text-shadow property applies shadow to text. • In its simplest use, you only specify the horizontal shadow (2px) and the vertical shadow (3px): • Adding a blur effect to the shadow • Adding color to the shadow Syntax : .element { text-shadow: 2px 3px 1px #ccc; } Output Code – <!DOCTYPE html> <html> <head> <style> h1 { text-shadow: 2px 2px 5px red; } </style> </head> <body> <h1>Text-shadow effect!</h1> </body> </html> Text-shadow effect!
  • 15. Creating box shadows with CSS3 • The CSS box-shadow property applies shadow to elements. Syntax : .shadow { box-shadow: 0px 3px 5px #444; } Output Code – <!DOCTYPE html> <html> <head> <style> div { width: 300px; height: 100px; padding: 15px; background-color: yellow; box-shadow: 10px 10px 5px grey; } </style> </head> <body> <div>This is a div element with a box- shadow</div> </body> </html>
  • 16. Gradient backgrounds with CSS3 • CSS gradients let you display smooth transitions between two or more specified colors. • CSS defines two types of gradients: • Linear Gradients (goes down/up/left/right/diagonally) • Radial Gradients (defined by their center) Syntax background: linear-gradient(direction, color-stop1, color-stop2, ...); background: linear-gradient(angle, color-stop1, color-stop2); background: radial-gradient(shape size at position, start-color, ..., last-color);  The angle is specified as an angle between a horizontal line and the gradient line.  The shape parameter defines the shape. It can take the value circle or ellipse. The default value is ellipse.
  • 17. Example :- Code – <!DOCTYPE html> <html> <head> <style> #grad1 { height: 100px; background: red; /* For browsers that do not support gradients */ background: linear-gradient(to right, red , yellow); /* Standard syntax (must be last) */ } #grad2 { height: 100px; background: red; /* For browsers that do not support gradients */ background: linear-gradient(-90deg, red, yellow); /* Standard syntax (must be last) */ } #grad3 { height: 150px; width: 200px; background: red; /* For browsers that do not support gradients */ background: radial-gradient(circle, red, yellow, green); /* Standard syntax (must be last) */ } #grad4 { height: 200px; background: red; /* For browsers that do not support gradients */ background: repeating-linear-gradient(90deg,red,yellow 7%,green 10%); /* Standard syntax (must be last) */ } </style> </head> <body> <h1>Linear Gradient - Left to Right</h1> <div id="grad1"></div> <h1>Linear Gradient - Left to Right with angle</h1> <div id="grad2" style="text-align:center;">-90deg</div><br> <h1>Radial Gradient - Shapes</h1> <div id="grad3"></div> <h1>A repeating gradient on 90deg starting red and finishing green:</h1> <div id="grad4"></div> </body> </html> Output
  • 18. CSS3 Transitions, Transformations and Animations • CSS3 transitions allows to change property values smoothly, over a given duration. • Properties of Transitions are: • Transition • Transition-delay • Transition-duration • Transition-property • Transition-timing-function Output
  • 19. • CSS3 Transformation provides following transformation methods: • Translate() • Rotate() • scaleX() • scaleY() • scale() • skewX() • skewY() • skew() • matrix() Output
  • 20. • CSS3 allows animation of HTML elements without using JavaScript or Flash. • Properties of Animations are: • @keyframes • animation-name • animation-duration • animation-delay • animation-iteration-count • animation-direction • animation-timing-function • animation-fill-mode Output
  • 21. MU Exam Questions May 2017 • Explain how to design a responsive web with HTML5 and CSS. 10 marks Dec 2018 • Explain in detail Responsive web design with an example. 10 marks • What are major differences between CSS3 and CSS2. 10 marks May 2019 • Explain in detail Responsive web design using HTML5 and CSS3 with an example. 10 marks • Create a web page to show how you can apply the transformation effects so that the image rotates by 150 degree. Assume suitable parameters if required. 10 marks
  翻译: