SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
HTML & CSS
An Introduction
By Mario Hernandez
Web Designer & Front-End Developer
Web: designsdrive.com
Twitter: @DesignsDrive
Agenda
HTML5
● Document Object Model (DOM)
● Doctype
● Semantic Tags
● Comments
● Best practices
Agenda
CSS3
● What it is, how it works & how to use
● IDs vs. Classes
● Inline and Block Elements
● Shorthand
● FLOATS
● Comments
● Intro to CSS3 Properties (if time permits)
Agenda
Putting it all together
● Project Structure
● Website Layouts
● Tools to Improve Workflow
What is HTML?
Wikipedia:
is the main markup language for creating web pages and other
information that can be displayed in a web browser.
Setting the standards
World Wide Web Consortium (W3C)
The Web Hypertext Application Technology Working Group
(WHATWG) i
Document Object Model (DOM)
The HTML DOM defines a standard way for
accessing and manipulating HTML documents.
DOCUMENTDOM
DOCUMENT
ROOT ELEMENT
HTML
DOM
DOCUMENT
ROOT ELEMENT
HTML
ELEMENT
<HEAD>
DOM
DOCUMENT
ROOT ELEMENT
HTML
ELEMENT
<HEAD>
ELEMENT
<BODY>
DOM
DOCUMENT
ROOT ELEMENT
HTML
ELEMENT
<HEAD>
ELEMENT
<BODY>
ELEMENT
<TITLE>
DOM
DOCUMENT
ROOT ELEMENT
HTML
ELEMENT
<HEAD>
ELEMENT
<BODY>
ELEMENT
<TITLE> ELEMENT
<p>
ELEMENT
<a>
ELEMENT
<H1>
DOM
Doctype
HTML4:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Doctype
HTML4:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
HTML5
<!Doctype html>
HTML5 Semantic Elements
Semantic = Meaning
Semantic Elements = Elements with meaning
HTML5 Semantic Elements
Semantic = Meaning
Semantic Elements = Elements with meaning
Examples of non-semantic elements: <div> and <span> -
Tells nothing about its content.
Examples of semantic elements: <form>, <table>,
and <img> - Clearly defines its content.
HTML5 Semantic Elements
New HTML5 Semantic Elements Include:
<header>
<nav>
<section>
<article>
<hgroup>
<canvas>
<video>
<audio>
<aside>
<figcaption>
<figure>
<footer>
HTML5 Semantic Elements
Visual Representation of new HTML5 Semantic Elements
Comments
<!-- Single line HTML comment -->
<!-- This is a multiple line HTML comment
when there is a need to be more detailed -->
Best Practices
● Comment
● Semantic Tags
● Separate Markup, Styling and Scripting
HANDS-ON
What is CSS?
Wikipedia:
Cascading Style Sheets (CSS) is a style sheet language used for
describing the look and formatting of a document written in a markup
language. Its most common application is to style web pages written
in HTML and XHTML.
How it works
Syntax:
A CSS rule has two parts, a selector and one or more
declarations.
How to use
● External Style Sheet
● Internal Style Sheet
● Inline Style
How to use
External Stylesheet
<head>
<link rel="stylesheet" type="text/css" href="styles.
css">
</head>
You can use one or multiple stylesheets
How to use
Internal Stylesheet
<head>
<style type="text/css">
body {color: black; font-family: Helvetica, Verdana,
san-serif;}
p {line-height: 1.5;font-size:14px;}
</style>
</head>
How to use
Inline Style
<div style="background: black; color: white">
...
</div>
Cascading
● Browser default
● External style sheet
● Internal style sheet (in the head section)
● Inline style (inside an HTML element)
Rules are applied from top to bottom. Last rule will
overwrite previous rules.
IDs vs. Classes
IDs are prefixed with #
Classes are prefixed with a period (.)
Example: #myID
Example: .myClass
IDs vs. Classes
<div id="myID">This is a container</div>
<div class="myClass">This is a
container</div>
IDs or Classes can use UPPER and lower case. They can
also use numeric values as well as non-alpha-numeric
values
Examples: MYID, myclass, my-id
Inline & Block Elements
Inline elements are those that on their own have no effect in
the structure or layout of a page.
Example: <span>, <em>, <a>, <strong>
Inline & Block Elements
Inline elements are those that on their own have no effect in
the structure or layout of a page.
Example: <span>, <em>, <a>, <strong>
Block level elements are those that affect the structure and
layout of a page.
Example: <div>, <p>, h1-h6
Inline & Block Elements
Inline elements are those that on their own have no effect in
the structure or layout of a page.
Example: <span>, <em>, <a>, <strong>
Block level elements are those that affect the structure and
layout of a page.
Example: <div>, <p>, h1-h6
Block level elements generate a line break and can have
dimensions.
Shorthand
p {margin: 4px 4px 4px 4px;}
p {margin:4px;}
.box {
border-top: 1px solid #000000;
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
border-left: 1px solid #000000;
}
.box {border: 1px solid #000;}
Shorthand
body {
background-color: #FFFFFF;
background-image: bg.jpg;
background-position: left top;
background-repeat: repeat;
}
body {background: #FFF url(bg.jpg) 0 0 no-
repeat;}
Floats
Hands-on demo
Resources
TWITTER.com
http://www.w3schools.com/
http://paulaborowska.com/a-brief-introduction-to-html5-2/
CSS-Tricks.com
http://html5please.com/
http://css3please.com/
http://www.abookapart.com/products/html5-for-web-designers
http://www.abookapart.com/products/css3-for-web-designers
http://readwrite.com/2013/05/31/programming-core-skill-21st-century
Questions
Mario Hernandez
http://designsdrive.com
Twitter
@DesignsDrive
Email
designsdrive@gmail.com

Contenu connexe

Tendances

Tendances (20)

Html
HtmlHtml
Html
 
Html for beginners
Html for beginnersHtml for beginners
Html for beginners
 
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
 
Web Development using HTML & CSS
Web Development using HTML & CSSWeb Development using HTML & CSS
Web Development using HTML & CSS
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
Basic Html Notes
Basic Html NotesBasic Html Notes
Basic Html Notes
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
 
CSS
CSSCSS
CSS
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
How to learn HTML in 10 Days
How to learn HTML in 10 DaysHow to learn HTML in 10 Days
How to learn HTML in 10 Days
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Html ppt
Html pptHtml ppt
Html ppt
 
Html basics
Html basicsHtml basics
Html basics
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Javascript
JavascriptJavascript
Javascript
 
Html
HtmlHtml
Html
 
Html coding
Html codingHtml coding
Html coding
 
Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
Bootstrap 5 ppt
Bootstrap 5 pptBootstrap 5 ppt
Bootstrap 5 ppt
 

Similaire à Introduction to HTML and CSS

GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
Heather Rock
 
Teched Inetrgation ppt and lering in simple
Teched Inetrgation ppt  and lering in simpleTeched Inetrgation ppt  and lering in simple
Teched Inetrgation ppt and lering in simple
JagadishBabuParri
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
Tesfaye Yenealem
 
Intro webtechstc
Intro webtechstcIntro webtechstc
Intro webtechstc
cmcsubho
 

Similaire à Introduction to HTML and CSS (20)

Html, css and jquery introduction
Html, css and jquery introductionHtml, css and jquery introduction
Html, css and jquery introduction
 
Web Designing
Web DesigningWeb Designing
Web Designing
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
 
wd project.pptx
wd project.pptxwd project.pptx
wd project.pptx
 
Html presentation
Html presentationHtml presentation
Html presentation
 
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]
 
DHTML
DHTMLDHTML
DHTML
 
Teched Inetrgation ppt and lering in simple
Teched Inetrgation ppt  and lering in simpleTeched Inetrgation ppt  and lering in simple
Teched Inetrgation ppt and lering in simple
 
Cascading style-sheet-
Cascading style-sheet-Cascading style-sheet-
Cascading style-sheet-
 
Rapid HTML Prototyping with Bootstrap 4
Rapid HTML Prototyping with Bootstrap 4Rapid HTML Prototyping with Bootstrap 4
Rapid HTML Prototyping with Bootstrap 4
 
Css.html
Css.htmlCss.html
Css.html
 
Css training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentials
 
Web development basics (Part-1)
Web development basics (Part-1)Web development basics (Part-1)
Web development basics (Part-1)
 
Introduction to html & css
Introduction to html & cssIntroduction to html & css
Introduction to html & css
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
 
Html and html5 cheat sheets
Html and html5 cheat sheetsHtml and html5 cheat sheets
Html and html5 cheat sheets
 
SDP_-_Module_4.ppt
SDP_-_Module_4.pptSDP_-_Module_4.ppt
SDP_-_Module_4.ppt
 
Web development using HTML and CSS
Web development using HTML and CSSWeb development using HTML and CSS
Web development using HTML and CSS
 
Intro webtechstc
Intro webtechstcIntro webtechstc
Intro webtechstc
 
Html-meeting1-1.pptx
Html-meeting1-1.pptxHtml-meeting1-1.pptx
Html-meeting1-1.pptx
 

Plus de Mario Hernandez

Introduction to Drupal Content Management System
Introduction to Drupal Content Management SystemIntroduction to Drupal Content Management System
Introduction to Drupal Content Management System
Mario Hernandez
 

Plus de Mario Hernandez (15)

Responsive images in Drupal 8
Responsive images in Drupal 8Responsive images in Drupal 8
Responsive images in Drupal 8
 
Component-driven Drupal Theming
Component-driven Drupal ThemingComponent-driven Drupal Theming
Component-driven Drupal Theming
 
Responsive design with flexbox
Responsive design with flexboxResponsive design with flexbox
Responsive design with flexbox
 
Building your first d8 theme
Building your first d8 themeBuilding your first d8 theme
Building your first d8 theme
 
HTML5 and CSS3
HTML5 and CSS3HTML5 and CSS3
HTML5 and CSS3
 
Introduction to drupal
Introduction to drupalIntroduction to drupal
Introduction to drupal
 
Rapid wireframing and prototyping
Rapid wireframing and prototypingRapid wireframing and prototyping
Rapid wireframing and prototyping
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS Frameworks
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
CSS Framework + Progressive Enhacements
CSS Framework + Progressive EnhacementsCSS Framework + Progressive Enhacements
CSS Framework + Progressive Enhacements
 
Introduction to Drupal Content Management System
Introduction to Drupal Content Management SystemIntroduction to Drupal Content Management System
Introduction to Drupal Content Management System
 
CSS3 for web designer - How to design a visually appealing website
CSS3 for web designer - How to design a visually appealing websiteCSS3 for web designer - How to design a visually appealing website
CSS3 for web designer - How to design a visually appealing website
 
960 Grid System - A hands-on introduction
960 Grid System -  A hands-on introduction960 Grid System -  A hands-on introduction
960 Grid System - A hands-on introduction
 
Front end-design and best practices
Front end-design and best practicesFront end-design and best practices
Front end-design and best practices
 
An introduction to the 960 grid system
An introduction to the 960 grid systemAn introduction to the 960 grid system
An introduction to the 960 grid system
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Introduction to HTML and CSS