Introduction to HTML and CSS

Mario Hernandez
Mario HernandezFront-End Developer um Mediacurrent
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
1 von 39

Recomendados

Introduction to HTML von
Introduction to HTMLIntroduction to HTML
Introduction to HTMLAjay Khatri
410 views43 Folien
Hushang Gaikwad von
Hushang GaikwadHushang Gaikwad
Hushang GaikwadHushnag Gaikwad
287 views13 Folien
Html / CSS Presentation von
Html / CSS PresentationHtml / CSS Presentation
Html / CSS PresentationShawn Calvert
78.9K views96 Folien
HTML CSS Basics von
HTML CSS BasicsHTML CSS Basics
HTML CSS BasicsMai Moustafa
47.6K views63 Folien
Html basics von
Html basicsHtml basics
Html basicsmcatahir947
2.8K views67 Folien
(Fast) Introduction to HTML & CSS von
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS Dave Kelly
3.4K views23 Folien

Más contenido relacionado

Was ist angesagt?

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
Basic Html Knowledge for students von
Basic Html Knowledge for studentsBasic Html Knowledge for students
Basic Html Knowledge for studentsvethics
2.9K views62 Folien
Css Ppt von
Css PptCss Ppt
Css PptHema Prasanth
19.8K views24 Folien
An Overview of HTML, CSS & Java Script von
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptFahim Abdullah
11.3K views56 Folien
HTML CSS & Javascript von
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & JavascriptDavid Lindkvist
11.7K views59 Folien
HTML and CSS crash course! von
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!Ana Cidre
2.7K views29 Folien

Was ist angesagt?(20)

Intro to HTML and CSS basics von Eliran Eliassy
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
Eliran Eliassy2.3K 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
An Overview of HTML, CSS & Java Script von Fahim Abdullah
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
Fahim Abdullah11.3K views
HTML and CSS crash course! von Ana Cidre
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
Ana Cidre2.7K views
HTML, CSS and Java Scripts Basics von Sun Technlogies
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
Sun Technlogies4.7K views
Cascading style sheets (CSS) von Harshita Yadav
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
Harshita Yadav3.9K views
Cascading Style Sheets (CSS) help von casestudyhelp
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
casestudyhelp1.8K views

Similar a Introduction to HTML and CSS

Html, css and jquery introduction von
Html, css and jquery introductionHtml, css and jquery introduction
Html, css and jquery introductioncncwebworld
77 views18 Folien
GDI Seattle Intermediate HTML and CSS Class 1 von
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1Heather Rock
786 views76 Folien
wd project.pptx von
wd project.pptxwd project.pptx
wd project.pptxdsffsdf1
25 views28 Folien
Html presentation von
Html presentationHtml presentation
Html presentationJordan Dichev
581 views33 Folien
Internet and Web Technology (CLASS-4) [CSS & JS] von
Internet and Web Technology (CLASS-4) [CSS & JS] Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS] Ayes Chinmay
311 views18 Folien

Similar a Introduction to HTML and CSS(20)

Html, css and jquery introduction von cncwebworld
Html, css and jquery introductionHtml, css and jquery introduction
Html, css and jquery introduction
cncwebworld77 views
GDI Seattle Intermediate HTML and CSS Class 1 von Heather Rock
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
Heather Rock786 views
wd project.pptx von dsffsdf1
wd project.pptxwd project.pptx
wd project.pptx
dsffsdf125 views
Internet and Web Technology (CLASS-4) [CSS & JS] von Ayes Chinmay
Internet and Web Technology (CLASS-4) [CSS & JS] Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS]
Ayes Chinmay311 views
Cascading style-sheet- von Nimrakhan89
Cascading style-sheet-Cascading style-sheet-
Cascading style-sheet-
Nimrakhan8928 views
Css training tutorial css3 &amp; css4 essentials von QA TrainingHub
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentials
QA TrainingHub216 views
Intro webtechstc von cmcsubho
Intro webtechstcIntro webtechstc
Intro webtechstc
cmcsubho212 views

Más de Mario Hernandez

Responsive images in Drupal 8 von
Responsive images in Drupal 8Responsive images in Drupal 8
Responsive images in Drupal 8Mario Hernandez
348 views34 Folien
Component-driven Drupal Theming von
Component-driven Drupal ThemingComponent-driven Drupal Theming
Component-driven Drupal ThemingMario Hernandez
486 views38 Folien
Responsive design with flexbox von
Responsive design with flexboxResponsive design with flexbox
Responsive design with flexboxMario Hernandez
780 views30 Folien
Building your first d8 theme von
Building your first d8 themeBuilding your first d8 theme
Building your first d8 themeMario Hernandez
607 views28 Folien
HTML5 and CSS3 von
HTML5 and CSS3HTML5 and CSS3
HTML5 and CSS3Mario Hernandez
614 views57 Folien
Introduction to drupal von
Introduction to drupalIntroduction to drupal
Introduction to drupalMario Hernandez
754 views19 Folien

Más de Mario Hernandez(15)

Rapid wireframing and prototyping von Mario Hernandez
Rapid wireframing and prototypingRapid wireframing and prototyping
Rapid wireframing and prototyping
Mario Hernandez1.3K views
CSS Framework + Progressive Enhacements von Mario Hernandez
CSS Framework + Progressive EnhacementsCSS Framework + Progressive Enhacements
CSS Framework + Progressive Enhacements
Mario Hernandez1.3K views
Introduction to Drupal Content Management System von Mario Hernandez
Introduction to Drupal Content Management SystemIntroduction to Drupal Content Management System
Introduction to Drupal Content Management System
Mario Hernandez694 views
CSS3 for web designer - How to design a visually appealing website von Mario Hernandez
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
Mario Hernandez1.5K views
960 Grid System - A hands-on introduction von Mario Hernandez
960 Grid System -  A hands-on introduction960 Grid System -  A hands-on introduction
960 Grid System - A hands-on introduction
Mario Hernandez6.1K views
Front end-design and best practices von Mario Hernandez
Front end-design and best practicesFront end-design and best practices
Front end-design and best practices
Mario Hernandez1.3K views
An introduction to the 960 grid system von Mario Hernandez
An introduction to the 960 grid systemAn introduction to the 960 grid system
An introduction to the 960 grid system
Mario Hernandez1.8K views

Último

GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... von
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
85 views32 Folien
Melek BEN MAHMOUD.pdf von
Melek BEN MAHMOUD.pdfMelek BEN MAHMOUD.pdf
Melek BEN MAHMOUD.pdfMelekBenMahmoud
14 views1 Folie
The Research Portal of Catalonia: Growing more (information) & more (services) von
The Research Portal of Catalonia: Growing more (information) & more (services)The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)CSUC - Consorci de Serveis Universitaris de Catalunya
80 views25 Folien
Igniting Next Level Productivity with AI-Infused Data Integration Workflows von
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Safe Software
263 views86 Folien
Scaling Knowledge Graph Architectures with AI von
Scaling Knowledge Graph Architectures with AIScaling Knowledge Graph Architectures with AI
Scaling Knowledge Graph Architectures with AIEnterprise Knowledge
30 views15 Folien

Último(20)

GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... von James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson85 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows von Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software263 views
Unit 1_Lecture 2_Physical Design of IoT.pdf von StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 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
Piloting & Scaling Successfully With Microsoft Viva von Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Special_edition_innovator_2023.pdf von WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors von sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab19 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
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
The details of description: Techniques, tips, and tangents on alternative tex... von BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada127 views
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf von Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf

Introduction to HTML and CSS