SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
HTML & CSS
The basics
HTML CSS JavaScript
Structure Style Behaviour
HyperText Markup Language
HTML
Common HTML terms
Elements Tags Attributes
<h1>I’m a HTML Element</h1>
<p>so am I!</p>
<a>We’re a tag</a>
<h2>because I</h2>
<p>have brackets</p>
<a href="http://shayhowe.com/">
You find me
</a>
<p title="I'm a tooltip">
after an equal sign
</p>
HTML document
structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
<p>This is a web page.</p>
</body>
</html>
HTML CHEAT SHEET
DOCUMENT OUTLINE
<!DOCTYPE>
<html>
<head>
<body>
Version of html
HTML document
Page information
Page documents
COMMENTS
<!--comment text-->
PAGE INFORMATION
<base/>
<meta/>
<title>
<link/>
<style>
<script>
Base URL
Meta data
Title
Relevant resource
Style resource
Script esource
DOCUMENT STRUCTURE
<h[1-6]>
<div>
<span>
<p>
<br/>
<hr/>
Heading
Page section
Inline section
Paragraph
Line break
Horizontal rule
LINKS
<a href=””>
<a href=”mailto:”>
<a href=”name”>
<a href=”#name”>
Page link
Email link
Anchor
Link to anchor
TEXT MARKUP
<strong>
<em>
<blockquote>
<q>
<abbr>
<acronym>
<address>
<pre>
<dfn>
<code>
<cite>
<del>
<ins>
<sub>
<sup>
<bdo>
Strong emphasis
Empahasis
Long quotation
Short quotation
Abrreviation
Acronym
Address
Pre-formatted text
Definition
Code
Citation
Deleted text
Inserted text
Subscript
Superscript
Text direction
<form>
<fieldset>
<legend>
<label>
<input/>
<select>
<optgroup>
<option>
<textarea>
<button>
Form
Collection of fields
Form legend
Input label
Form input
Drop-down box
Group of options
Drop-down options
Large text input
Button
FORMS
IMAGES AND IMAGE MAPS
<img/>
<map>
<area/>
Image
Image map
Area of image map
LISTS
<ol>
<ul>
<li>
<dl>
<dt>
<dd>
Ordered list
Unordered list
List item
Definition list
Definition term
Term description
TABLES
<table>
<caption>
<thead>
<tbody>
<tfoot>
<colgroup>
<col/>
<tr>
<th>
<td>
Table
Caption
Table header
Table body
Table footer
Column group
Column
Table row
Header cell
Table cell
CORE ATTRIBUTES
class
id
style
title
*<br/> empty tags
EMPTY ELEMENTS
<br>
<embed>
<hr>
<img>
<input>
<link>
<meta>
<param>
<source>
<wbr>
Break
Embed
thematic break
image
input
lnk
meta
parameter
source
thematic break
EXERCISE 1
Create a HTML document
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
</body>
</html>
1. Create a folder
1.1 Create a file called index.html
2. Make the file a html readable document:
3. Inside the <head> element, let’s add <meta> and <title> elements.
<head>
<meta charset="utf-8">
<title>Hello World</title>
</head>
4. Inside the <body> element, add <h1> and <p> elements.
<body>
<h1>Put a header here</h1>
<p>And some text here</p>
</body>
5. Let’s check it out!
Double-clicking this file or dragging it into a web browser
will open it for us to review.
Cascading Style Sheets
CSS
Common CSS terms
Selectors Properties Values
p { ... }
h1 { ... }
p {
color: ...;
font-size: ...;
}
h1 {
font-family: ...;
font-size: ...;
}
p {
color: green;
font-size: 16;
}
h1 {
font-family: Arial;
font-size: 24;
}
Selectors
Type Selectors
Type selectors target elements by their element type
div { ... }
<div>...</div>
CSS
HTML
<div>...</div>
Class selectors allow us to select an element based on
the element’s class attribute value.
Class Selectors
.awesome { ... }
<div class=”awesome”>...</div>
CSS
HTML
ID Selectors
#anacidre { ... }
<div id=”anacidre”>...</div>
CSS
HTML
ID selectors are even more precise than class selectors, as they
target only one unique element at a time.
Additional Selectors
Many more advanced selectors
exist and are readily available
Referencing CSS
In order to get our CSS talking to our HTML, we need to reference our
CSS file within our HTML.
<head>
<link rel="stylesheet" href="main.css">
</head>
Create a StyleSheet
EXERCISE 2
1.1 Inside of our “styles-conference” folder, let’s create a new
folder named “assets.”
1. Create a folder named “styles-conference” inside our initial
folder.
1.2 For our style sheets, let’s go ahead and add another
folder named “stylesheets” inside the “assets” folder.
1.3 A new file named main.css and save it within the
“stylesheets” folder we just created.
1.4 Head over to Eric’s website, copy his reset, and paste
it at the top of our main.css file:
http://meyerweb.com/eric/tools/css/reset/
2. Let’s connect our stylesheet to our index.html file.
<head>
<meta charset="utf-8">
<title>Your title here</title>
<link rel="stylesheet" href="main.css">
</head>
3. Do some CSS-ing!
color
background
background-color
background-attachment
background-repeat
background-image
background-position
CSS CHEAT SHEET
FONTS
font
font-family
font-style
font-variant
font-weight
font-stretch
font-size
font-size-adjust
TEXT
COLOR/BACKGROUND
BOX MODEL
TEXT MARKUP
margin
margin-top
margin-right
margin-bottom
margin-left
padding
padding-top
padding-right
padding-bottom
padding-left
border
border-top
border-bottom
border-right
border-left
border-color
border-top-color
border-right-color
border-bottom-color
border-left-color
border-style
border-top-style
border-right-style
border-bottom-style
border-left-style
border-width
border-top-width
border-right-width
border-bottom-width
border-left-width
:first-child
:first-line
:first-letter
:hover
:active
:focus
:link
:visited
:lang(var)
:before
:after
PSEUDO-SELECTORS /CLASSES
TABLES
caption-side
table-layout
border-collapse
border-spacing
empty-cells
speak-header
DIMENSIONS
POSITIONING
SELECTORS
*
div
div*
div span
div, span
div > span
div + span
.class
div.class
#itemid
div#itemid
a[attr]
a[lang|=‘en’]
All elements
<div>
All elements within <div>
<span> within <div>
<div> and <span>
<span> with parent <div>
<span> preceded by <div>
Elements of class “class”
<div> of class “class”
<div> with “itemid”
<a> with attribute “attr”
<a> when lang begins “en”
display
position
top
right
bottom
left
float
clear
z-index
direction +
unicode-bidi
overflow
clip
visibility
text-indent
text-align
text-decoration
text-shadow
letter-spacing
word-spacing
text-transform
white-space
line-height width
min-width
max-width
height
min-height
max-height
vertical-align
Content
Padding
Border
Margin

Contenu connexe

Tendances

Meta tags
Meta tagsMeta tags
Meta tags
hapy
 

Tendances (20)

Html
HtmlHtml
Html
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Html,javascript & css
Html,javascript & cssHtml,javascript & css
Html,javascript & css
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Meta tags
Meta tagsMeta tags
Meta tags
 
HTML, CSS, JavaScript for beginners
HTML, CSS, JavaScript for beginnersHTML, CSS, JavaScript for beginners
HTML, CSS, JavaScript for beginners
 
HTML5
HTML5HTML5
HTML5
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Html introduction
Html introductionHtml introduction
Html introduction
 
Html for beginners
Html for beginnersHtml for beginners
Html for beginners
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
CSS
CSSCSS
CSS
 
Html basics
Html basicsHtml basics
Html basics
 
Html and css
Html and cssHtml and css
Html and css
 
Html training slide
Html training slideHtml training slide
Html training slide
 

Similaire à HTML and CSS crash course!

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Terry Ryan
 
Html css crash course may 11th, atlanta
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
Thinkful
 
UVA MDST 3073 CSS 2012-09-20
UVA MDST 3073 CSS 2012-09-20UVA MDST 3073 CSS 2012-09-20
UVA MDST 3073 CSS 2012-09-20
Rafael Alvarado
 
Darwin web standards
Darwin web standardsDarwin web standards
Darwin web standards
Justin Avery
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-template
Inventis Web Architects
 

Similaire à HTML and CSS crash course! (20)

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
HTML & CSS 2017
HTML & CSS 2017HTML & CSS 2017
HTML & CSS 2017
 
CSS.pdf
CSS.pdfCSS.pdf
CSS.pdf
 
Html intro
Html introHtml intro
Html intro
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
SharePointfest Denver - A jQuery Primer for SharePoint
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePoint
 
Creative Web 2 - CSS
Creative Web 2 - CSS Creative Web 2 - CSS
Creative Web 2 - CSS
 
Html css crash course may 11th, atlanta
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
 
UVA MDST 3073 CSS 2012-09-20
UVA MDST 3073 CSS 2012-09-20UVA MDST 3073 CSS 2012-09-20
UVA MDST 3073 CSS 2012-09-20
 
Semantic HTML5
Semantic HTML5Semantic HTML5
Semantic HTML5
 
Darwin web standards
Darwin web standardsDarwin web standards
Darwin web standards
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
 
What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)
 
Frontend for developers
Frontend for developersFrontend for developers
Frontend for developers
 
HTML CSS and Web Development
HTML CSS and Web DevelopmentHTML CSS and Web Development
HTML CSS and Web Development
 
46h interaction 1.lesson Hello world
46h interaction 1.lesson Hello world46h interaction 1.lesson Hello world
46h interaction 1.lesson Hello world
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-template
 
Html, css and jquery introduction
Html, css and jquery introductionHtml, css and jquery introduction
Html, css and jquery introduction
 
Web
WebWeb
Web
 
Css
CssCss
Css
 

Dernier

Dernier (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
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...
 
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...
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

HTML and CSS crash course!

  • 1. HTML & CSS The basics
  • 4. Common HTML terms Elements Tags Attributes <h1>I’m a HTML Element</h1> <p>so am I!</p> <a>We’re a tag</a> <h2>because I</h2> <p>have brackets</p> <a href="http://shayhowe.com/"> You find me </a> <p title="I'm a tooltip"> after an equal sign </p>
  • 6. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Hello World</title> </head> <body> <h1>Hello World</h1> <p>This is a web page.</p> </body> </html>
  • 7.
  • 8. HTML CHEAT SHEET DOCUMENT OUTLINE <!DOCTYPE> <html> <head> <body> Version of html HTML document Page information Page documents COMMENTS <!--comment text--> PAGE INFORMATION <base/> <meta/> <title> <link/> <style> <script> Base URL Meta data Title Relevant resource Style resource Script esource DOCUMENT STRUCTURE <h[1-6]> <div> <span> <p> <br/> <hr/> Heading Page section Inline section Paragraph Line break Horizontal rule LINKS <a href=””> <a href=”mailto:”> <a href=”name”> <a href=”#name”> Page link Email link Anchor Link to anchor TEXT MARKUP <strong> <em> <blockquote> <q> <abbr> <acronym> <address> <pre> <dfn> <code> <cite> <del> <ins> <sub> <sup> <bdo> Strong emphasis Empahasis Long quotation Short quotation Abrreviation Acronym Address Pre-formatted text Definition Code Citation Deleted text Inserted text Subscript Superscript Text direction <form> <fieldset> <legend> <label> <input/> <select> <optgroup> <option> <textarea> <button> Form Collection of fields Form legend Input label Form input Drop-down box Group of options Drop-down options Large text input Button FORMS IMAGES AND IMAGE MAPS <img/> <map> <area/> Image Image map Area of image map LISTS <ol> <ul> <li> <dl> <dt> <dd> Ordered list Unordered list List item Definition list Definition term Term description TABLES <table> <caption> <thead> <tbody> <tfoot> <colgroup> <col/> <tr> <th> <td> Table Caption Table header Table body Table footer Column group Column Table row Header cell Table cell CORE ATTRIBUTES class id style title *<br/> empty tags
  • 10. EXERCISE 1 Create a HTML document
  • 11. <!DOCTYPE html> <html lang="en"> <head> </head> <body> </body> </html> 1. Create a folder 1.1 Create a file called index.html 2. Make the file a html readable document:
  • 12. 3. Inside the <head> element, let’s add <meta> and <title> elements. <head> <meta charset="utf-8"> <title>Hello World</title> </head>
  • 13. 4. Inside the <body> element, add <h1> and <p> elements. <body> <h1>Put a header here</h1> <p>And some text here</p> </body>
  • 14. 5. Let’s check it out! Double-clicking this file or dragging it into a web browser will open it for us to review.
  • 16. Common CSS terms Selectors Properties Values p { ... } h1 { ... } p { color: ...; font-size: ...; } h1 { font-family: ...; font-size: ...; } p { color: green; font-size: 16; } h1 { font-family: Arial; font-size: 24; }
  • 17.
  • 19. Type Selectors Type selectors target elements by their element type div { ... } <div>...</div> CSS HTML <div>...</div>
  • 20. Class selectors allow us to select an element based on the element’s class attribute value. Class Selectors .awesome { ... } <div class=”awesome”>...</div> CSS HTML
  • 21. ID Selectors #anacidre { ... } <div id=”anacidre”>...</div> CSS HTML ID selectors are even more precise than class selectors, as they target only one unique element at a time.
  • 22. Additional Selectors Many more advanced selectors exist and are readily available
  • 24. In order to get our CSS talking to our HTML, we need to reference our CSS file within our HTML. <head> <link rel="stylesheet" href="main.css"> </head>
  • 26. 1.1 Inside of our “styles-conference” folder, let’s create a new folder named “assets.” 1. Create a folder named “styles-conference” inside our initial folder. 1.2 For our style sheets, let’s go ahead and add another folder named “stylesheets” inside the “assets” folder. 1.3 A new file named main.css and save it within the “stylesheets” folder we just created. 1.4 Head over to Eric’s website, copy his reset, and paste it at the top of our main.css file: http://meyerweb.com/eric/tools/css/reset/
  • 27. 2. Let’s connect our stylesheet to our index.html file. <head> <meta charset="utf-8"> <title>Your title here</title> <link rel="stylesheet" href="main.css"> </head>
  • 28. 3. Do some CSS-ing!
  • 29. color background background-color background-attachment background-repeat background-image background-position CSS CHEAT SHEET FONTS font font-family font-style font-variant font-weight font-stretch font-size font-size-adjust TEXT COLOR/BACKGROUND BOX MODEL TEXT MARKUP margin margin-top margin-right margin-bottom margin-left padding padding-top padding-right padding-bottom padding-left border border-top border-bottom border-right border-left border-color border-top-color border-right-color border-bottom-color border-left-color border-style border-top-style border-right-style border-bottom-style border-left-style border-width border-top-width border-right-width border-bottom-width border-left-width :first-child :first-line :first-letter :hover :active :focus :link :visited :lang(var) :before :after PSEUDO-SELECTORS /CLASSES TABLES caption-side table-layout border-collapse border-spacing empty-cells speak-header DIMENSIONS POSITIONING SELECTORS * div div* div span div, span div > span div + span .class div.class #itemid div#itemid a[attr] a[lang|=‘en’] All elements <div> All elements within <div> <span> within <div> <div> and <span> <span> with parent <div> <span> preceded by <div> Elements of class “class” <div> of class “class” <div> with “itemid” <a> with attribute “attr” <a> when lang begins “en” display position top right bottom left float clear z-index direction + unicode-bidi overflow clip visibility text-indent text-align text-decoration text-shadow letter-spacing word-spacing text-transform white-space line-height width min-width max-width height min-height max-height vertical-align Content Padding Border Margin