SlideShare a Scribd company logo
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 and CSS crash course!
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;
}
HTML and CSS crash course!
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

More Related Content

What's hot (20)

PPTX
Html5 and-css3-overview
Jacob Nelson
 
PPTX
Basic HTML
Sayan De
 
PPT
Introduction to JavaScript (1).ppt
MuhammadRehan856177
 
PPTX
(Fast) Introduction to HTML & CSS
Dave Kelly
 
PPTX
Css position
Webtech Learning
 
PPTX
Css
Hemant Saini
 
PPTX
Html
yugank_gupta
 
PPTX
Html and css
Sukrit Gupta
 
PDF
Introduction to HTML and CSS
Mario Hernandez
 
PDF
Introduction to HTML5
Gil Fink
 
PPT
Html ppt
Iblesoft
 
PPTX
1 03 - CSS Introduction
apnwebdev
 
PPT
Cascading Style Sheets (CSS) help
casestudyhelp
 
PPTX
CSS
DivyaKS12
 
PPTX
Html ppt
Ruchi Kumari
 
PPTX
Basic Html Knowledge for students
vethics
 
PPTX
Images and Tables in HTML
Aarti P
 
PPTX
Html5 Basics
Pankaj Bajaj
 
KEY
HTML CSS & Javascript
David Lindkvist
 
PPT
Html basics
mcatahir947
 
Html5 and-css3-overview
Jacob Nelson
 
Basic HTML
Sayan De
 
Introduction to JavaScript (1).ppt
MuhammadRehan856177
 
(Fast) Introduction to HTML & CSS
Dave Kelly
 
Css position
Webtech Learning
 
Html and css
Sukrit Gupta
 
Introduction to HTML and CSS
Mario Hernandez
 
Introduction to HTML5
Gil Fink
 
Html ppt
Iblesoft
 
1 03 - CSS Introduction
apnwebdev
 
Cascading Style Sheets (CSS) help
casestudyhelp
 
Html ppt
Ruchi Kumari
 
Basic Html Knowledge for students
vethics
 
Images and Tables in HTML
Aarti P
 
Html5 Basics
Pankaj Bajaj
 
HTML CSS & Javascript
David Lindkvist
 
Html basics
mcatahir947
 

Similar to HTML and CSS crash course! (20)

PPTX
gdg Introduction to HTML-CSS-Javascript.pptx
saurabh45tiwari
 
PPTX
Introduction to HTML-CSS-Javascript.pptx
deepak37877
 
PDF
Introduction to HTML-CSS-Javascript.pdf
DakshPratapSingh1
 
PPTX
Workshop 2 Slides.pptx
DaniyalSardar
 
PDF
Web Design & Development - Session 2
Shahrzad Peyman
 
PDF
HTML2.pdf
202GCET19
 
PDF
Web app development_html_css_03
Hassen Poreya
 
PPTX
Introduction to Wed System And Technologies (1).pptx
AmeerHamza183012
 
PPTX
wd project.pptx
dsffsdf1
 
PPTX
Html-Prabakaran
DrPrabakaranPerumal
 
PPTX
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
usmanahmadawan
 
PDF
Html / CSS Presentation
Shawn Calvert
 
PDF
Basic Details of HTML and CSS.pdf
Kalyani Government Engineering College
 
PDF
HTML+CSS: how to get started
Dimitris Tsironis
 
PPSX
Introduction to css
Evolution Network
 
PDF
Web 101
OneDesignCompany
 
PPTX
HTML5 and CSS Fundamentals MOOC Course College Presentation
KuchBhi90
 
PPT
xhtml_css.ppt
fakeaccount225095
 
PPTX
Web Information Systems Html and css
Artificial Intelligence Institute at UofSC
 
PPTX
Web 102 INtro to CSS
Hawkman Academy
 
gdg Introduction to HTML-CSS-Javascript.pptx
saurabh45tiwari
 
Introduction to HTML-CSS-Javascript.pptx
deepak37877
 
Introduction to HTML-CSS-Javascript.pdf
DakshPratapSingh1
 
Workshop 2 Slides.pptx
DaniyalSardar
 
Web Design & Development - Session 2
Shahrzad Peyman
 
HTML2.pdf
202GCET19
 
Web app development_html_css_03
Hassen Poreya
 
Introduction to Wed System And Technologies (1).pptx
AmeerHamza183012
 
wd project.pptx
dsffsdf1
 
Html-Prabakaran
DrPrabakaranPerumal
 
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
usmanahmadawan
 
Html / CSS Presentation
Shawn Calvert
 
Basic Details of HTML and CSS.pdf
Kalyani Government Engineering College
 
HTML+CSS: how to get started
Dimitris Tsironis
 
Introduction to css
Evolution Network
 
HTML5 and CSS Fundamentals MOOC Course College Presentation
KuchBhi90
 
xhtml_css.ppt
fakeaccount225095
 
Web Information Systems Html and css
Artificial Intelligence Institute at UofSC
 
Web 102 INtro to CSS
Hawkman Academy
 
Ad

Recently uploaded (20)

PDF
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Priyanka Aash
 
PDF
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
The Growing Value and Application of FME & GenAI
Safe Software
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
PPTX
𝙳𝚘𝚠𝚗𝚕𝚘𝚊𝚍—Wondershare Filmora Crack 14.0.7 + Key Download 2025
sebastian aliya
 
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Priyanka Aash
 
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
Kubernetes - Architecture & Components.pdf
geethak285
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
The Growing Value and Application of FME & GenAI
Safe Software
 
Practical Applications of AI in Local Government
OnBoard
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
𝙳𝚘𝚠𝚗𝚕𝚘𝚊𝚍—Wondershare Filmora Crack 14.0.7 + Key Download 2025
sebastian aliya
 
Ad

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>
  • 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; }
  • 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