SlideShare una empresa de Scribd logo
1 de 47
Introduction to
HTML & CSSDan Paquette
www.danpaquette.net
All programs start
as empty text files*
*Hint: a website is a program.
So let’s
create
a text file.
• Create a folder on your
desktop.
• Open Notepad.
• Save it as index.html in your
folder.
• Open it in your browser.
• Pat yourself on the back.
• Having trouble? On a Mac?
Go to:
https://codepen.io/pen/
Let’s Learn HTML
HTML means Hypertext Markup Language
Learning the Syntax
Learning the Syntax
Learning the Syntax
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
index.html
Document structure and the Doctype.
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
</body>
</html>
My Website
The title tag.
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>My Website</h1>
<p>Welcome to my website!</p>
</body>
</html>
My Website
The title tag.
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>My Website</h1>
<h2>My Website</h2>
<h3>My Website</h3>
<h4>My Website</h4>
<h5>My Website</h5>
<h6>My Website</h6>
</body>
</html>
My Website
Heading tags.
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<p>
Welcome to my <em>totally</em>
<strong>awesome</strong> website!
</p>
</body>
</html>
My Website
Inline tags and semantics.
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<ul>
<li>List Item</li>
<li>List Item</li>
</ul>
<ol>
<li>List Item</li>
<li>List Item</li>
</ol>
</body>
</html>
My Website
The ordered list and unordered list tags.
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<a href="https://www.google.com">
This is a link to Google!
</a>
</body>
</html>
My Website
The anchor tag.
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<div>
<p>
This is a paragraph inside of a div
</p>
</div>
</body>
</html>
My Website
The divider tag.
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<img
src="https://i.imgur.com/INMtSvO.jpg"
alt="Image description." />
</body>
</html>
<!--
I broke the <img /> tag up because it was too long. You
should do it all on one line.
Also, this is an HTML comment.
It’s useful when you need to tell other people working on
your site how your code works so they don’t get confused.
-->
My Website
The image tag.
List of All HTML Tags
<a> <abbr> <address> <area> <article> <aside> <audio> <base>
<bdi> <bdo> <blockquote> <body> <br> <button> <canvas>
<caption> <cite> <code> <col> <colgroup> <data> <datalist> <dd>
<del> <details> <dfn> <div> <dl> <dt> <em> <embed> <fieldset>
<figcaption> <figure> <footer> <form> <h1> <h2> <h3> <h4> <h5>
<h6> <head> <header> <hr> <html> <iframe> <img> <input> <ins>
<kbd> <label> <legend> <li> <link> <main> <map> <mark> <meta>
<meter> <nav> <noframes> <noscript> <object> <ol> <optgroup>
<option> <output> <p> <param> <pre> <progress> <q> <rp> <rt>
<rtc> <ruby> <samp> <script> <section> <select> <slot> <small>
<source> <span> <strong> <style> <sub> <summary> <sup> <table>
<tbody> <td> <template> <textarea> <tfoot> <th> <thead> <time>
<title> <tr> <track> <ul> <var> <video> <wbr>
HTML Reference
https://developer.mozilla.org/en-US/docs/Web/HTML/Eleme
Let’s Learn CSS
CSS means Cascading Style Sheets
Let’s create
another text
file.
• New, blank Notepad file.
• Save it as styles.css in the
same folder as your
index.html.
• Pat yourself on the back.
• Having trouble? On a Mac?
Go to:
https://codepen.io/pen/
Learning the Syntax
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<link rel="stylesheet"
href="styles.css" />
</head>
<body>
</body>
</html>
<!--
Again, I broke the tag up because it was too long. You
should do it all on one line.
If you’re on CodePen, you don’t have to do this step, but
you should learn it.
-->
My Website
Linking the stylesheet.
<p>
This is my paragraph!
</p>
<!--
I left out all the other stuff for brevity, but you
still need it in your files!
-->
My Website
HTML
p {
background: green;
}
CSS
Let’s make it green!
<p>
This is my paragraph!
</p>
My Website
HTML
p {
background: green;
color: white;
}
CSS
Let’s make it readable.
<p>
This is my paragraph! Let’s
make it longer!
</p>
My Website
HTML
p {
background: green;
color: white;
width: 150px;
height: 150px;
border-radius: 5px;
}
CSS
Styles for everything under the sun.
<p>
This is my paragraph! Let’s
make it longer!
</p>
<p class="special-paragraph">
This is my paragraph! Let’s
make it longer!
</p>
My Website
HTML
p {
background: green;
color: white;
width: 150px;
height: 150px;
border-radius: 5px;
}
.special-paragraph {
background: red;
}
/*
The period means we’re selecting a class
name rather than a tag.
*/
CSS
Class is in session.
<div class="container">
<p>
This is my paragraph! Let’s
make it longer!
</p>
<p class="special-paragraph">
This is my paragraph! Let’s
make it longer!
</p>
</div>
My Website
HTML
p {
background: green;
color: white;
width: 150px;
height: 150px;
border-radius: 5px;
}
.special-paragraph {
background: red;
}
.container {
display: flex; /* Advanced! */
}
CSS
Let’s make them side-by-side.
<p>
This is my paragraph! Let’s
make it longer!
</p>
Now I’m down here!
My Website
HTML
p {
background: green;
color: white;
width: 150px;
height: 150px;
border-radius: 5px;
margin-bottom: 100px;
}
CSS
Styles for everything under the sun.
<p>
This is my paragraph! Let’s
make it longer!
</p>
My Website
HTML
p {
background: green;
color: white;
width: 150px;
height: 150px;
border-radius: 5px;
padding: 10px;
}
/*
We added padding. Why did our box get
bigger?
*/
CSS
Padding. Cool, but what happened?
Learning the Box Model
<p class="special-paragraph">
This is my paragraph!
</p>
My Website
HTML
p {
width: 100px;
height: 100px;
padding: 10px;
}
.special-paragraph {
background: green;
}
.special-paragraph {
background: orange;
}
CSS
Learning the cascade.
<div class="special-div">
<p class="special-paragraph">
This is my paragraph!
</p>
</div>
My Website
HTML
p {
width: 100px;
height: 100px;
padding: 10px;
}
.special-div > .special-paragraph {
background: green;
}
CSS
The child selector.
<div class="special-div">
<p class="special-paragraph">
This is my paragraph!
</p>
</div>
My Website
HTML
p {
width: 100px;
height: 100px;
padding: 10px;
}
.special-div > .special-paragraph {
background: green;
}
.special-paragraph {
background: orange;
}
CSS
Specificity.
<div class="special-div">
<p>
This is my paragraph!
</p>
</div>
My Website
HTML
.special-div {
font-family: arial;
background: green;
color: white;
font-weight: bold;
}
/*
Certain properties, like font styles, colors, and
weights, inherit down to child DOM nodes.
*/
CSS
Inheritance.
<div class="special-div">
<p>
This is my paragraph!
</p>
</div>
My Website
HTML
.special-div {
padding: 10px;
background: green;
border: 3px solid red;
}
.special-div > p {
border: inherit;
}
/*
But you can make anything inherit if you try hard
enough.
*/
CSS
Inheritance, continued.
<div class="special-div">
<p>
This is my
<strong>paragraph</strong>!
</p>
<ul>
<li>
<strong>List Item</strong>
</li>
</ul>
</div>
My Website
HTML
.special-div strong {
color: red;
}
CSS
The descendant selector.
<p class="special-paragraph">
This is my paragraph!
</p>
<p class="other-special-paragraph">
This is my paragraph!
</p>
My Website
HTML
.special-paragraph,
.other-special-paragraph {
color: red;
}
CSS
Multiple selectors, one rule.
There’s a lot we
didn’t cover.
But you’ve got the basics, and the rest is
just knowing where to look.
Mozilla Developer Network
References
https://developer.mozilla.org/en-US/docs/Web/HTML/Eleme
https://developer.mozilla.org/en-US/docs/Web/CSS/Referenc
Validators
HTML: https://validator.w3.org/
CSS: https://jigsaw.w3.org/css-validator/
Code Editors
https://code.visualstudio.com/https://atom.io/
Tutorials and Learning Aids
https://css-tricks.com/ https://www.codecademy.com/
https://caniuse.com/ https://stackoverflow.com/
The Best Learning Tool
The Best Browser
Developer Tools
Chrome: View > Developer >
Developer Tools
Firefox: Tools > Developer > Toggle
Tools
Edge: F12
Safari: Develop > Show Web
Inspector
Thanks for listening!And feel free to ask questions!

Más contenido relacionado

La actualidad más candente

Html Intro2
Html Intro2Html Intro2
Html Intro2
mlackner
 

La actualidad más candente (20)

CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Introducing Cascading Style Sheets
Introducing Cascading Style SheetsIntroducing Cascading Style Sheets
Introducing Cascading Style Sheets
 
Hushang Gaikwad
Hushang GaikwadHushang Gaikwad
Hushang Gaikwad
 
Css ppt
Css pptCss ppt
Css ppt
 
Advanced Cascading Style Sheets
Advanced Cascading Style SheetsAdvanced Cascading Style Sheets
Advanced Cascading Style Sheets
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Html Intro2
Html Intro2Html Intro2
Html Intro2
 
Presentation on html, css
Presentation on html, cssPresentation on html, css
Presentation on html, css
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
Html & CSS
Html & CSSHtml & CSS
Html & CSS
 
Css
CssCss
Css
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
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)
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
 
Learning Html
Learning HtmlLearning Html
Learning Html
 

Similar a Introduction to HTML and CSS

Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
Aslam Najeebdeen
 
Artdm171 Week3 Tags Group Projects
Artdm171 Week3 Tags Group ProjectsArtdm171 Week3 Tags Group Projects
Artdm171 Week3 Tags Group Projects
guestca5654
 
Fwd week2 tw-20120903
Fwd week2 tw-20120903Fwd week2 tw-20120903
Fwd week2 tw-20120903
TerryWeber
 
HTML5 - An Introduction
HTML5 - An IntroductionHTML5 - An Introduction
HTML5 - An Introduction
Timmy Kokke
 

Similar a Introduction to HTML and CSS (20)

Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
 
Day of code
Day of codeDay of code
Day of code
 
Critical Rendering Path
Critical Rendering PathCritical Rendering Path
Critical Rendering Path
 
[SUTD GDSC] Intro to HTML and CSS
[SUTD GDSC] Intro to HTML and CSS[SUTD GDSC] Intro to HTML and CSS
[SUTD GDSC] Intro to HTML and CSS
 
Please dont touch-3.6-jsday
Please dont touch-3.6-jsdayPlease dont touch-3.6-jsday
Please dont touch-3.6-jsday
 
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and GulpOptimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
 
HTML & CSS 2017
HTML & CSS 2017HTML & CSS 2017
HTML & CSS 2017
 
Artdm171 Week3 Tags Group Projects
Artdm171 Week3 Tags Group ProjectsArtdm171 Week3 Tags Group Projects
Artdm171 Week3 Tags Group Projects
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
 
TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5
 
Fwd week2 tw-20120903
Fwd week2 tw-20120903Fwd week2 tw-20120903
Fwd week2 tw-20120903
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS Frameworks
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Developing Your Ultimate Package
Developing Your Ultimate PackageDeveloping Your Ultimate Package
Developing Your Ultimate Package
 
Introduction to web development
Introduction to web developmentIntroduction to web development
Introduction to web development
 
HTML5 - An Introduction
HTML5 - An IntroductionHTML5 - An Introduction
HTML5 - An Introduction
 
Wordless, stop writing WordPress themes like it's 1998
Wordless, stop writing WordPress themes like it's 1998Wordless, stop writing WordPress themes like it's 1998
Wordless, stop writing WordPress themes like it's 1998
 

Último

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 

Introduction to HTML and CSS