SlideShare a Scribd company logo
1 of 30
Introduction to
<HTML5> && CSS3{}
HTML5
History of HTML
What is HTML?
● Hyper Text Markup Language
● A standardized way of tagging text files on world wide web
● HTML elements are represented by tags
● Browsers do not display the HTML tags, but use them to render the content of
the page
Demo HTML
<html>
<head>
<title>Welcome</title>
</head>
<body>
<p>Welcome to Mindfire</p>
</body>
</html>
How browser interprets
● Constructs the Object Model (DOMs)
Deep into Object Model Construction
● Constructs the render tree
Deep into Render-tree Construction
● Paints the layout in browser window
Document Object Model (DOM)
● The DOM is a W3C (World Wide Web Consortium) standard for accessing
document
● A Programming interface so that programs can change the document structure
● Object oriented representation of the document
● Each tag/markup is treated as nodes in DOM tree
HTML DOM Hierarchy
HTML Tags/Elements
● <tagname>Content goes here...</tagname> - Has start and end tag
<h1>My First Heading</h1>
<p>My first paragraph.</p>
● Empty Elements - Doesn’t have end
<br>
<img src="img.png" alt="img">
HTML Tags/Elements (Cont.)
● meta - Metadata about the HTML document - machine parseable but not
displayed in the browser
More
● style - To include styles (CSS)
<style>
h1 {color:red;}
p {color:blue;}
</style>
● script - To include scripts
<script>
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
HTML Attributes
● Attributes provide additional information about an element
● Attributes are always specified in the start tag
● Attributes usually come in name/value pairs like: name="value"
● An HTML element can have multiple attributes
Ex:
<img src="img.png" alt="img">
<div id="div1" class="heading">Hello</div>
HTML Attributes (Cont.)
● id - Defines an id to a element unique to the document
● class - To group few elements togather
● data - Used to store custom data private to the page
Ex:
<div id=”div1” class=”heading” data-page=”2”>Hello</div>
HTML Comments
<!-- Write your comments here -->
Tables
● <table></table> - Defines an HTML table
● <tr></tr> - Defines a row of the table
○ <td></td> - Defines a cell in the row
○ <th></th> - Defines a cell as a column heading
Lists
Unordered List: <ul>
● Item <li>
● Item <li>
Ordered List: <ol>
1. First item <li>
2. Second item <li>
Forms
● Used to collect user inputs
● Form - <form></form> -- Defines HTML form
● Elements - Goes inside form tag
● Attributes
Ex:
○ method
○ action
Events
● Event attributes can be used with HTML tags
● Any script or function can be triggered on any event
Ex:
<button onclick="myFunction()">Click me</button>
New Elements in HTML5
Other New Features in HTML5
● Built-in audio and video support (without plugins)
● Enhanced form controls and attributes
● The Canvas (a way to draw directly on a web page)
● Drag and Drop functionality
● Support for CSS3 (the newer and more powerful version of CSS)
● More advanced features for web developers, such as data storage and offline
applications.
HTML5 Doctype
The <html> Element
CSS3
What is CSS?
● CSS stands for Cascading Style Sheets
● CSS describes how HTML elements are to be displayed on screen or in other
media
Ex:
Types of CSS
● External CSS - Including CSS from an external file
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
● Internal CSS - Writing CSS within head tag
<head>
<style>
body {
background-color: linen;
}
</style>
</head>
● Inline CSS - Defining CSS in HTML style attribute
<h1 style="color:blue;margin-left:30px;">This is a heading</h1>
CSS Selectors
● Id selector - #id
● Class selector - .class-name
● Element - div
● Attribute - [required] or [target=_blank]
○ a[href^="https"] - Selects every <a> element whose href attribute value begins with "https"
○ a[href$=".pdf"] - Selects every <a> element whose href attribute value ends with ".pdf"
● Colon (:)
○ a:hover - Selects links on mouse over
○ P:first-child - Selects every <p> element that is the first child of its parent
Ref: https://www.w3schools.com/CSSref/css_selectors.asp
CSS Examples
● Margine
div {
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
}
● Padding
div {
padding: 25px 50px 75px 100px;
}
● Units (fixed and relative)
○ px - One pixel is equal to one dot on the computer screen (mainly used in screen media) - fixed
○ pt - One point is equal to 1/72 of an inch (mainly used in print media) - fixed
○ em - An em is equal to the current font-size - relative
○ % - Percent of the outer container - relative
Media Queries
● To define different style rules for different media types
● Can be applied on the following things:
○ Width and height of the viewport
○ Width and height of the device
○ Orientation (is the tablet/phone in landscape or portrait mode?)
○ Resolution
● Syntax
@media not|only mediatype and (expressions) {
CSS-Code;
}
Media Queries (Cont.)
● Example:
@media screen and (min-width: 480px) {
body {
background-color: lightgreen;
}
}
● Loading external CSS based on media
<link rel="stylesheet" media="screen and (min-width: 480px)"
href="print.css">
New in CSS3
● rem Unit - Relative to the font-size of the root element -- like em
● Flex display type -
display: flex;
● Grid layouts
More
● New animations and transitions
<Thank> You{}

More Related Content

What's hot (20)

Xml p2 Lecture Notes
Xml p2 Lecture NotesXml p2 Lecture Notes
Xml p2 Lecture Notes
 
Html training part1
Html training part1Html training part1
Html training part1
 
Xml Lecture Notes
Xml Lecture NotesXml Lecture Notes
Xml Lecture Notes
 
Chilliz
ChillizChilliz
Chilliz
 
Html 5
Html 5Html 5
Html 5
 
HTML Intro
HTML IntroHTML Intro
HTML Intro
 
Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS] Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS]
 
Html
HtmlHtml
Html
 
Xml p5 Lecture Notes
Xml p5 Lecture NotesXml p5 Lecture Notes
Xml p5 Lecture Notes
 
Html tutorials by www.dmdiploma.com
Html tutorials by www.dmdiploma.comHtml tutorials by www.dmdiploma.com
Html tutorials by www.dmdiploma.com
 
Dom date and objects and event handling
Dom date and objects and event handlingDom date and objects and event handling
Dom date and objects and event handling
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Unit iv xml dom
Unit iv xml domUnit iv xml dom
Unit iv xml dom
 
Pseudo CSS Selectors
Pseudo CSS SelectorsPseudo CSS Selectors
Pseudo CSS Selectors
 
Basics of Cascading Style sheets
Basics of Cascading Style sheetsBasics of Cascading Style sheets
Basics of Cascading Style sheets
 
Css selectors
Css selectorsCss selectors
Css selectors
 
Html
HtmlHtml
Html
 
The Document Object Model
The Document Object ModelThe Document Object Model
The Document Object Model
 
Html
HtmlHtml
Html
 
Dhtml ppt (2)
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)
 

Similar to Introduction to html5 and css3

T430-01-Introduction to HTML.pptx
T430-01-Introduction to HTML.pptxT430-01-Introduction to HTML.pptx
T430-01-Introduction to HTML.pptxawadalsabbah
 
Javascript part 2 DOM.pptx
Javascript part 2 DOM.pptxJavascript part 2 DOM.pptx
Javascript part 2 DOM.pptxdeepa339830
 
Hypertext markup language(html)
Hypertext markup language(html)Hypertext markup language(html)
Hypertext markup language(html)Jayson Cortez
 
Neoito — How modern browsers work
Neoito — How modern browsers workNeoito — How modern browsers work
Neoito — How modern browsers workNeoito
 
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvZahouAmel1
 
Introduction to Html5, css, Javascript and Jquery
Introduction to Html5, css, Javascript and JqueryIntroduction to Html5, css, Javascript and Jquery
Introduction to Html5, css, Javascript and Jqueryvaluebound
 
Web Page Designing
Web Page DesigningWeb Page Designing
Web Page DesigningAmit Mali
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxAliRaza899305
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxKADAMBARIPUROHIT
 
wd project.pptx
wd project.pptxwd project.pptx
wd project.pptxdsffsdf1
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptxAlisha Kamat
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptxGDSCVJTI
 

Similar to Introduction to html5 and css3 (20)

T430-01-Introduction to HTML.pptx
T430-01-Introduction to HTML.pptxT430-01-Introduction to HTML.pptx
T430-01-Introduction to HTML.pptx
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
HTML
HTMLHTML
HTML
 
Javascript part 2 DOM.pptx
Javascript part 2 DOM.pptxJavascript part 2 DOM.pptx
Javascript part 2 DOM.pptx
 
Hypertext markup language(html)
Hypertext markup language(html)Hypertext markup language(html)
Hypertext markup language(html)
 
Neoito — How modern browsers work
Neoito — How modern browsers workNeoito — How modern browsers work
Neoito — How modern browsers work
 
Html5 ppt
Html5 pptHtml5 ppt
Html5 ppt
 
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
 
Dhtml chapter2
Dhtml chapter2Dhtml chapter2
Dhtml chapter2
 
Introduction to Html5, css, Javascript and Jquery
Introduction to Html5, css, Javascript and JqueryIntroduction to Html5, css, Javascript and Jquery
Introduction to Html5, css, Javascript and Jquery
 
Web Page Designing
Web Page DesigningWeb Page Designing
Web Page Designing
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Html
HtmlHtml
Html
 
Html5
Html5Html5
Html5
 
Html ppt
Html pptHtml ppt
Html ppt
 
wd project.pptx
wd project.pptxwd project.pptx
wd project.pptx
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 

Recently uploaded (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Introduction to html5 and css3

  • 4. What is HTML? ● Hyper Text Markup Language ● A standardized way of tagging text files on world wide web ● HTML elements are represented by tags ● Browsers do not display the HTML tags, but use them to render the content of the page
  • 6. How browser interprets ● Constructs the Object Model (DOMs) Deep into Object Model Construction ● Constructs the render tree Deep into Render-tree Construction ● Paints the layout in browser window
  • 7. Document Object Model (DOM) ● The DOM is a W3C (World Wide Web Consortium) standard for accessing document ● A Programming interface so that programs can change the document structure ● Object oriented representation of the document ● Each tag/markup is treated as nodes in DOM tree
  • 9. HTML Tags/Elements ● <tagname>Content goes here...</tagname> - Has start and end tag <h1>My First Heading</h1> <p>My first paragraph.</p> ● Empty Elements - Doesn’t have end <br> <img src="img.png" alt="img">
  • 10. HTML Tags/Elements (Cont.) ● meta - Metadata about the HTML document - machine parseable but not displayed in the browser More ● style - To include styles (CSS) <style> h1 {color:red;} p {color:blue;} </style> ● script - To include scripts <script> document.getElementById("demo").innerHTML = "Hello JavaScript!"; </script>
  • 11. HTML Attributes ● Attributes provide additional information about an element ● Attributes are always specified in the start tag ● Attributes usually come in name/value pairs like: name="value" ● An HTML element can have multiple attributes Ex: <img src="img.png" alt="img"> <div id="div1" class="heading">Hello</div>
  • 12. HTML Attributes (Cont.) ● id - Defines an id to a element unique to the document ● class - To group few elements togather ● data - Used to store custom data private to the page Ex: <div id=”div1” class=”heading” data-page=”2”>Hello</div>
  • 13. HTML Comments <!-- Write your comments here -->
  • 14. Tables ● <table></table> - Defines an HTML table ● <tr></tr> - Defines a row of the table ○ <td></td> - Defines a cell in the row ○ <th></th> - Defines a cell as a column heading
  • 15. Lists Unordered List: <ul> ● Item <li> ● Item <li> Ordered List: <ol> 1. First item <li> 2. Second item <li>
  • 16. Forms ● Used to collect user inputs ● Form - <form></form> -- Defines HTML form ● Elements - Goes inside form tag ● Attributes Ex: ○ method ○ action
  • 17. Events ● Event attributes can be used with HTML tags ● Any script or function can be triggered on any event Ex: <button onclick="myFunction()">Click me</button>
  • 19. Other New Features in HTML5 ● Built-in audio and video support (without plugins) ● Enhanced form controls and attributes ● The Canvas (a way to draw directly on a web page) ● Drag and Drop functionality ● Support for CSS3 (the newer and more powerful version of CSS) ● More advanced features for web developers, such as data storage and offline applications.
  • 22. CSS3
  • 23. What is CSS? ● CSS stands for Cascading Style Sheets ● CSS describes how HTML elements are to be displayed on screen or in other media Ex:
  • 24. Types of CSS ● External CSS - Including CSS from an external file <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> ● Internal CSS - Writing CSS within head tag <head> <style> body { background-color: linen; } </style> </head> ● Inline CSS - Defining CSS in HTML style attribute <h1 style="color:blue;margin-left:30px;">This is a heading</h1>
  • 25. CSS Selectors ● Id selector - #id ● Class selector - .class-name ● Element - div ● Attribute - [required] or [target=_blank] ○ a[href^="https"] - Selects every <a> element whose href attribute value begins with "https" ○ a[href$=".pdf"] - Selects every <a> element whose href attribute value ends with ".pdf" ● Colon (:) ○ a:hover - Selects links on mouse over ○ P:first-child - Selects every <p> element that is the first child of its parent Ref: https://www.w3schools.com/CSSref/css_selectors.asp
  • 26. CSS Examples ● Margine div { margin-top: 100px; margin-bottom: 100px; margin-right: 150px; margin-left: 80px; } ● Padding div { padding: 25px 50px 75px 100px; } ● Units (fixed and relative) ○ px - One pixel is equal to one dot on the computer screen (mainly used in screen media) - fixed ○ pt - One point is equal to 1/72 of an inch (mainly used in print media) - fixed ○ em - An em is equal to the current font-size - relative ○ % - Percent of the outer container - relative
  • 27. Media Queries ● To define different style rules for different media types ● Can be applied on the following things: ○ Width and height of the viewport ○ Width and height of the device ○ Orientation (is the tablet/phone in landscape or portrait mode?) ○ Resolution ● Syntax @media not|only mediatype and (expressions) { CSS-Code; }
  • 28. Media Queries (Cont.) ● Example: @media screen and (min-width: 480px) { body { background-color: lightgreen; } } ● Loading external CSS based on media <link rel="stylesheet" media="screen and (min-width: 480px)" href="print.css">
  • 29. New in CSS3 ● rem Unit - Relative to the font-size of the root element -- like em ● Flex display type - display: flex; ● Grid layouts More ● New animations and transitions