SlideShare a Scribd company logo
HTML5 & CSS3
AN INTRODUCTION
1
Why HTML5?
HTML5
+
CSS3
+
Javascript
2
Semantic Syntax
with
Modern Styling
for
Better Interaction
 Semantic Tags
 New form elements & attributes
 CSS Selectors
 CSS Box model
 Responsive vs Adaptive Web Design
 Media Queries
 Web Storage
3
Not covered :
• Media tags – audio, video
• Canvas
• Geolocation
• Drag and drop
• Web workers
Semantic Tags
 Literally means ‘relating to’
 Describes the content to both the developer and the
browser
 Non semantic elements – div, span
 Described using ID and classes
 Header, footer, nav, article, section, aside, figure &
figcaption
 Example
4
5<header> defines the header of the document/ article/ section
<nav> defines the navigation links
<article> defines the primary content
<section> defines the sections
<aside> defines the
extra content
<footer> defines the footer of the document/ article/ section
Form elements
 Existing – text, password, radio button, checkbox, select,
button, file
 New tags –
 date, datetime, month, time , week
 email, number, range, search, tel, url
 Color, datalist
 Example
6
Cascading Style Sheets 7
 CSS Rule
 Selectors
 Box Model
 Display and Visibility
CSS Selectors
 Element selector – div, p
 Class selector - .className
 ID selector – #id
 Attribute selectors – input[type=“text”]
 Pseudo-selectors - :valid, :checked
 Quiz!
8
CSS Box model 9
Display and visibility
div {
display: inline; /* default, takes content width, no line breaks*/
display: inline-block; /* Characteristics of block, but sits on a line */
display: block; /* full width, line break before and after*/
display: none; /* Hide */ [visibility: hidden]
}
Others : Run-in, table, flex
10
Responsive vs Adaptive Web
Design
11
 RWD
 relies on flexible and fluid grids
 Changes with browser
 Content breaks apart & realigns
 AWD
 relies on predefined screen sizes.
 predefined sizes called breakpoints when different layouts are triggered
 Controlled by media queries
Responsive VS Adaptive
Media Query
@media not|only mediatype and (media feature) {
CSS-Code;
}
 Media Type
 Screen, print, handheld, all, etc.
 Media feature
 Width, height
 mi/n/max-device-width/height
 Aspect ratio
 Orientation, etc.
12
Media Query implementation
<!-- CSS media query on a link element -->
<link rel="stylesheet" media="(max-width: 800px)" href="example.css" />
<!-- CSS media query within a stylesheet -->
<style>
@media (max-width: 600px) {
selector{
display: none;
}
}
</style>
Example
13
Web Storage
 Store data in browser
 Client side key-value pairing
 Localstorage
 Persistent across sessions
 localStorage.setItem("localKey", "localValue");
 localStorage.getItem("localKey ");
 Session storage
 Lost at the end of session
 When browser is closed, data stored is lost
 sessionStorage.sessionKey="sessionValue"
 sessionStorage.sessionKey
14

More Related Content

What's hot

The Dark Arts of CSS
The Dark Arts of CSSThe Dark Arts of CSS
The Dark Arts of CSS
SiddharthBorderwala
 
html & css
html & css html & css
html & css
umesh patil
 
Web forms and html (lect 5)
Web forms and html (lect 5)Web forms and html (lect 5)
Web forms and html (lect 5)
Salman Memon
 
WEBD 162: Intro to CSS
WEBD 162: Intro to CSSWEBD 162: Intro to CSS
WEBD 162: Intro to CSS
palomateach
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
LearningTech
 
Drupal Training
Drupal TrainingDrupal Training
Drupal Training
Sam Davis
 
Lecture6 web design and development
Lecture6 web design and developmentLecture6 web design and development
Lecture6 web design and development
Rafi Haidari
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS Tricks
Andolasoft Inc
 
Html n CSS
Html n CSSHtml n CSS
Html n CSS
Sukrit Gupta
 
Unit iii css and javascript 1
Unit iii css and javascript 1Unit iii css and javascript 1
Unit iii css and javascript 1
Jesus Obenita Jr.
 
HTML and CSS
HTML and CSSHTML and CSS
HTML and CSS
Ketan Ghumatkar
 
Introduction css
Introduction cssIntroduction css
Introduction css
sagaroceanic11
 
CSS
CSSCSS
Web development using HTML and CSS
Web development using HTML and CSSWeb development using HTML and CSS
Web development using HTML and CSS
SiddhantSingh980217
 
CSS
CSSCSS
Page layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSSPage layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSS
Yaowaluck Promdee
 
WebsiteStructure
WebsiteStructureWebsiteStructure
WebsiteStructure
tutorialsruby
 
Media queries and frameworks
Media queries and frameworksMedia queries and frameworks
Media queries and frameworks
Nicole Ryan
 

What's hot (18)

The Dark Arts of CSS
The Dark Arts of CSSThe Dark Arts of CSS
The Dark Arts of CSS
 
html & css
html & css html & css
html & css
 
Web forms and html (lect 5)
Web forms and html (lect 5)Web forms and html (lect 5)
Web forms and html (lect 5)
 
WEBD 162: Intro to CSS
WEBD 162: Intro to CSSWEBD 162: Intro to CSS
WEBD 162: Intro to CSS
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
 
Drupal Training
Drupal TrainingDrupal Training
Drupal Training
 
Lecture6 web design and development
Lecture6 web design and developmentLecture6 web design and development
Lecture6 web design and development
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS Tricks
 
Html n CSS
Html n CSSHtml n CSS
Html n CSS
 
Unit iii css and javascript 1
Unit iii css and javascript 1Unit iii css and javascript 1
Unit iii css and javascript 1
 
HTML and CSS
HTML and CSSHTML and CSS
HTML and CSS
 
Introduction css
Introduction cssIntroduction css
Introduction css
 
CSS
CSSCSS
CSS
 
Web development using HTML and CSS
Web development using HTML and CSSWeb development using HTML and CSS
Web development using HTML and CSS
 
CSS
CSSCSS
CSS
 
Page layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSSPage layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSS
 
WebsiteStructure
WebsiteStructureWebsiteStructure
WebsiteStructure
 
Media queries and frameworks
Media queries and frameworksMedia queries and frameworks
Media queries and frameworks
 

Similar to Introduction to HTML5 and CSS3

Introduction to html & css
Introduction to html & cssIntroduction to html & css
Introduction to html & css
sesharao puvvada
 
Using Tailwind Shadow: An Easy Guide to Custom Shadows - Blogs
Using Tailwind Shadow: An Easy Guide to Custom Shadows - BlogsUsing Tailwind Shadow: An Easy Guide to Custom Shadows - Blogs
Using Tailwind Shadow: An Easy Guide to Custom Shadows - Blogs
RonDosh
 
Use Tailwind Select for Easy and Reliable Dropdowns - Blogs
Use Tailwind Select for Easy and Reliable Dropdowns - BlogsUse Tailwind Select for Easy and Reliable Dropdowns - Blogs
Use Tailwind Select for Easy and Reliable Dropdowns - Blogs
RonDosh
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
Doris Chen
 
A Complete Guide to Frontend - UI Developer
A Complete Guide to Frontend - UI DeveloperA Complete Guide to Frontend - UI Developer
A Complete Guide to Frontend - UI Developer
nariyaravi
 
Digibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David WalkerDigibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David Walker
Lizzie Hodgson
 
Optimizing Sites for Mobile Devices
Optimizing Sites for Mobile DevicesOptimizing Sites for Mobile Devices
Optimizing Sites for Mobile Devices
jameswillweb
 
Responsive Web Designed for your communication and marketing needs
Responsive Web Designed for your communication and marketing needsResponsive Web Designed for your communication and marketing needs
Responsive Web Designed for your communication and marketing needs
SEGIC
 
Responsive Web Design - What You Need to Know to Get Started
Responsive Web Design - What You Need to Know to Get StartedResponsive Web Design - What You Need to Know to Get Started
Responsive Web Design - What You Need to Know to Get Started
jennybchicken
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)Responsive web designing ppt(1)
Responsive web designing ppt(1)
admecindia1
 
Responsive Web Designing Fundamentals
Responsive Web Designing FundamentalsResponsive Web Designing Fundamentals
Responsive Web Designing Fundamentals
ADMEC Multimedia Institute
 
Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25
Christian Rokitta
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
Zohar Arad
 
Css
CssCss
Portfolio
PortfolioPortfolio
Portfolio
Priya Reddy Sama
 
A practical guide to building websites with HTML5 & CSS3
A practical guide to building websites with HTML5 & CSS3A practical guide to building websites with HTML5 & CSS3
A practical guide to building websites with HTML5 & CSS3
Darren Wood
 
Html5
Html5Html5
New Css style
New Css styleNew Css style
New Css style
BUDNET
 
The Future Of Digital Layout - Cutting Edge CSS Features
The Future Of Digital Layout - Cutting Edge CSS FeaturesThe Future Of Digital Layout - Cutting Edge CSS Features
The Future Of Digital Layout - Cutting Edge CSS Features
Andre JAY Meissner
 
web development presentation computer science
web development presentation computer scienceweb development presentation computer science
web development presentation computer science
girijasharma7777
 

Similar to Introduction to HTML5 and CSS3 (20)

Introduction to html & css
Introduction to html & cssIntroduction to html & css
Introduction to html & css
 
Using Tailwind Shadow: An Easy Guide to Custom Shadows - Blogs
Using Tailwind Shadow: An Easy Guide to Custom Shadows - BlogsUsing Tailwind Shadow: An Easy Guide to Custom Shadows - Blogs
Using Tailwind Shadow: An Easy Guide to Custom Shadows - Blogs
 
Use Tailwind Select for Easy and Reliable Dropdowns - Blogs
Use Tailwind Select for Easy and Reliable Dropdowns - BlogsUse Tailwind Select for Easy and Reliable Dropdowns - Blogs
Use Tailwind Select for Easy and Reliable Dropdowns - Blogs
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
A Complete Guide to Frontend - UI Developer
A Complete Guide to Frontend - UI DeveloperA Complete Guide to Frontend - UI Developer
A Complete Guide to Frontend - UI Developer
 
Digibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David WalkerDigibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David Walker
 
Optimizing Sites for Mobile Devices
Optimizing Sites for Mobile DevicesOptimizing Sites for Mobile Devices
Optimizing Sites for Mobile Devices
 
Responsive Web Designed for your communication and marketing needs
Responsive Web Designed for your communication and marketing needsResponsive Web Designed for your communication and marketing needs
Responsive Web Designed for your communication and marketing needs
 
Responsive Web Design - What You Need to Know to Get Started
Responsive Web Design - What You Need to Know to Get StartedResponsive Web Design - What You Need to Know to Get Started
Responsive Web Design - What You Need to Know to Get Started
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)Responsive web designing ppt(1)
Responsive web designing ppt(1)
 
Responsive Web Designing Fundamentals
Responsive Web Designing FundamentalsResponsive Web Designing Fundamentals
Responsive Web Designing Fundamentals
 
Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
 
Css
CssCss
Css
 
Portfolio
PortfolioPortfolio
Portfolio
 
A practical guide to building websites with HTML5 & CSS3
A practical guide to building websites with HTML5 & CSS3A practical guide to building websites with HTML5 & CSS3
A practical guide to building websites with HTML5 & CSS3
 
Html5
Html5Html5
Html5
 
New Css style
New Css styleNew Css style
New Css style
 
The Future Of Digital Layout - Cutting Edge CSS Features
The Future Of Digital Layout - Cutting Edge CSS FeaturesThe Future Of Digital Layout - Cutting Edge CSS Features
The Future Of Digital Layout - Cutting Edge CSS Features
 
web development presentation computer science
web development presentation computer scienceweb development presentation computer science
web development presentation computer science
 

Recently uploaded

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
FODUU
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 

Recently uploaded (20)

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 

Introduction to HTML5 and CSS3

  • 1. HTML5 & CSS3 AN INTRODUCTION 1
  • 3.  Semantic Tags  New form elements & attributes  CSS Selectors  CSS Box model  Responsive vs Adaptive Web Design  Media Queries  Web Storage 3 Not covered : • Media tags – audio, video • Canvas • Geolocation • Drag and drop • Web workers
  • 4. Semantic Tags  Literally means ‘relating to’  Describes the content to both the developer and the browser  Non semantic elements – div, span  Described using ID and classes  Header, footer, nav, article, section, aside, figure & figcaption  Example 4
  • 5. 5<header> defines the header of the document/ article/ section <nav> defines the navigation links <article> defines the primary content <section> defines the sections <aside> defines the extra content <footer> defines the footer of the document/ article/ section
  • 6. Form elements  Existing – text, password, radio button, checkbox, select, button, file  New tags –  date, datetime, month, time , week  email, number, range, search, tel, url  Color, datalist  Example 6
  • 7. Cascading Style Sheets 7  CSS Rule  Selectors  Box Model  Display and Visibility
  • 8. CSS Selectors  Element selector – div, p  Class selector - .className  ID selector – #id  Attribute selectors – input[type=“text”]  Pseudo-selectors - :valid, :checked  Quiz! 8
  • 10. Display and visibility div { display: inline; /* default, takes content width, no line breaks*/ display: inline-block; /* Characteristics of block, but sits on a line */ display: block; /* full width, line break before and after*/ display: none; /* Hide */ [visibility: hidden] } Others : Run-in, table, flex 10
  • 11. Responsive vs Adaptive Web Design 11  RWD  relies on flexible and fluid grids  Changes with browser  Content breaks apart & realigns  AWD  relies on predefined screen sizes.  predefined sizes called breakpoints when different layouts are triggered  Controlled by media queries Responsive VS Adaptive
  • 12. Media Query @media not|only mediatype and (media feature) { CSS-Code; }  Media Type  Screen, print, handheld, all, etc.  Media feature  Width, height  mi/n/max-device-width/height  Aspect ratio  Orientation, etc. 12
  • 13. Media Query implementation <!-- CSS media query on a link element --> <link rel="stylesheet" media="(max-width: 800px)" href="example.css" /> <!-- CSS media query within a stylesheet --> <style> @media (max-width: 600px) { selector{ display: none; } } </style> Example 13
  • 14. Web Storage  Store data in browser  Client side key-value pairing  Localstorage  Persistent across sessions  localStorage.setItem("localKey", "localValue");  localStorage.getItem("localKey ");  Session storage  Lost at the end of session  When browser is closed, data stored is lost  sessionStorage.sessionKey="sessionValue"  sessionStorage.sessionKey 14