HTML and CSS crash course!

A
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
1 von 29

Recomendados

HTML/CSS Crash Course (april 4 2017) von
HTML/CSS Crash Course (april 4 2017)HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)Daniel Friedman
627 views54 Folien
1 03 - CSS Introduction von
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introductionapnwebdev
1K views46 Folien
Html / CSS Presentation von
Html / CSS PresentationHtml / CSS Presentation
Html / CSS PresentationShawn Calvert
78.9K views96 Folien
CSS Day: CSS Grid Layout von
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout Rachel Andrew
9.6K views122 Folien
Intro to HTML and CSS basics von
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basicsEliran Eliassy
2.3K views133 Folien
Introduction to Cascading Style Sheets (CSS) von
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Chris Poteet
11.7K views27 Folien

Más contenido relacionado

Was ist angesagt?

Introduction to HTML and CSS von
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSMario Hernandez
4.1K views39 Folien
Cascading style sheet von
Cascading style sheetCascading style sheet
Cascading style sheetMichael Jhon
2K views21 Folien
Html basics von
Html basicsHtml basics
Html basicsmcatahir947
2.8K views67 Folien
Up to Speed on HTML 5 and CSS 3 von
Up to Speed on HTML 5 and CSS 3Up to Speed on HTML 5 and CSS 3
Up to Speed on HTML 5 and CSS 3M. Jackson Wilkinson
110K views67 Folien
How Cascading Style Sheets (CSS) Works von
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksAmit Tyagi
79.4K views38 Folien
Css ppt von
Css pptCss ppt
Css pptNidhi mishra
2.2K views30 Folien

Was ist angesagt?(20)

How Cascading Style Sheets (CSS) Works von Amit Tyagi
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
Amit Tyagi79.4K views
Beginners css tutorial for web designers von Singsys Pte Ltd
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
Singsys Pte Ltd3.2K views
Introduction to HTML von Ajay Khatri
Introduction to HTMLIntroduction to HTML
Introduction to HTML
Ajay Khatri410 views
CSS3 Media Queries von Russ Weakley
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
Russ Weakley22.5K views
(Fast) Introduction to HTML & CSS von Dave Kelly
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
Dave Kelly3.4K views
Presentation on html, css von Aamir Sohail
Presentation on html, cssPresentation on html, css
Presentation on html, css
Aamir Sohail575 views
HTML CSS JS in Nut shell von Ashwin Shiv
HTML  CSS JS in Nut shellHTML  CSS JS in Nut shell
HTML CSS JS in Nut shell
Ashwin Shiv251 views
Flexbox von Netcetera
FlexboxFlexbox
Flexbox
Netcetera5.7K views
Basic Html Knowledge for students von vethics
Basic Html Knowledge for studentsBasic Html Knowledge for students
Basic Html Knowledge for students
vethics2.9K views
Intro to HTML & CSS von Syed Sami
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
Syed Sami1.1K views

Similar a HTML and CSS crash course!

Introduction to HTML5 von
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Terry Ryan
7.5K views107 Folien
HTML & CSS 2017 von
HTML & CSS 2017HTML & CSS 2017
HTML & CSS 2017Colin Loretz
237 views117 Folien
Html intro von
Html introHtml intro
Html introRobyn Overstreet
2.3K views65 Folien
Introduction to HTML and CSS von
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSFerdous Mahmud Shaon
11.6K views80 Folien
SharePointfest Denver - A jQuery Primer for SharePoint von
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePointMarc D Anderson
7.5K views73 Folien
Creative Web 2 - CSS von
Creative Web 2 - CSS Creative Web 2 - CSS
Creative Web 2 - CSS Lukas Oppermann
360 views38 Folien

Similar a HTML and CSS crash course!(20)

Introduction to HTML5 von Terry Ryan
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Terry Ryan7.5K views
SharePointfest Denver - A jQuery Primer for SharePoint von Marc D Anderson
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePoint
Marc D Anderson7.5K views
Html css crash course may 11th, atlanta von Thinkful
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
Thinkful189 views
Semantic HTML5 von Terry Ryan
Semantic HTML5Semantic HTML5
Semantic HTML5
Terry Ryan18.2K views
Darwin web standards von Justin Avery
Darwin web standardsDarwin web standards
Darwin web standards
Justin Avery2.3K views
Building the basics (WordPress Ottawa 2014) von christopherfross
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
christopherfross782 views
What is HTML - An Introduction to HTML (Hypertext Markup Language) von Ahsan Rahim
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)
Ahsan Rahim1.8K views
HTML CSS and Web Development von Rahul Mishra
HTML CSS and Web DevelopmentHTML CSS and Web Development
HTML CSS and Web Development
Rahul Mishra1.8K views
46h interaction 1.lesson Hello world von hemi46h
46h interaction 1.lesson Hello world46h interaction 1.lesson Hello world
46h interaction 1.lesson Hello world
hemi46h550 views
Html, css and jquery introduction von cncwebworld
Html, css and jquery introductionHtml, css and jquery introduction
Html, css and jquery introduction
cncwebworld77 views
Thinkful - Frontend Crash Course - Intro to HTML/CSS von TJ Stalcup
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSS
TJ Stalcup187 views

Último

Info Session November 2023.pdf von
Info Session November 2023.pdfInfo Session November 2023.pdf
Info Session November 2023.pdfAleksandraKoprivica4
12 views15 Folien
Ransomware is Knocking your Door_Final.pdf von
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
55 views46 Folien
Data Integrity for Banking and Financial Services von
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial ServicesPrecisely
21 views26 Folien
Tunable Laser (1).pptx von
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptxHajira Mahmood
24 views37 Folien
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... von
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...Bernd Ruecker
37 views69 Folien
Evolving the Network Automation Journey from Python to Platforms von
Evolving the Network Automation Journey from Python to PlatformsEvolving the Network Automation Journey from Python to Platforms
Evolving the Network Automation Journey from Python to PlatformsNetwork Automation Forum
13 views21 Folien

Último(20)

Data Integrity for Banking and Financial Services von Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely21 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... von Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker37 views
Five Things You SHOULD Know About Postman von Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman33 views
handbook for web 3 adoption.pdf von Liveplex
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdf
Liveplex22 views
Transcript: The Details of Description Techniques tips and tangents on altern... von BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada136 views
Serverless computing with Google Cloud (2023-24) von wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun11 views
Empathic Computing: Delivering the Potential of the Metaverse von Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst478 views
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... von Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
STPI OctaNE CoE Brochure.pdf von madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb14 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 von IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive von Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive

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