SlideShare a Scribd company logo
Frontend Crash Course:
Intro to HTML/CSS
Access the slides: bit.ly/dc-html
© 2017 Thinkful. All Rights Reserved. 2
About me
David Coulter
Frontend developer and product manager for 10 years
at National Geographic, NGP Van, Arcadia Power
Mentor @ Thinkful
© 2017 Thinkful. All Rights Reserved. 3
About you
Why are you here?
Do you want to work better with developers?
Do you want to start working in tech?
Do you have an idea that you want to build?
Programming experience?
First lines of code will be written tonight?
Been self teaching for 1-3 months?
Been at this for 3+ months
© 2017 Thinkful. All Rights Reserved. 4
Goals
Learn core concepts of HTML/CSS to build websites
Complete drills to put those concepts into practice
Build your first website
Get comfortable with the feeling of learning
programming, especially struggling with a concept
Take home challenges to keep going
© 2017 Thinkful. All Rights Reserved. 5
How the web works
Type a URL from a client (e.g. google.com)
Browser communicates with DNS server to
find IP address
Browser sends an HTTP request asking
for specific files
Browser receives those files and renders
them as a website
© 2017 Thinkful. All Rights Reserved. 6
Client / Server
Client
Frontend Developer
Server
Backend Developer
© 2017 Thinkful. All Rights Reserved. 7
Client / Server
Request
Response
Client - UI Logic Server - Business Logic
Database Servers
© 2017 Thinkful. All Rights Reserved. 8
Example: Facebook
HTML, CSS, &
Javascript render
interactive newsfeed
Algorithm determines
what’s in your feed
Request
Get data about your
friends and their posts
Open browser and
navigate to
facebook.com
Business Logic
Database Servers
Response
© 2017 Thinkful. All Rights Reserved. 9
How that relates to what we’re doing
When we write HTML & CSS today, we are
creating those files that are stored on a server,
sent through a series of tubes, and then
rendered by your browser
© 2017 Thinkful. All Rights Reserved. 10
Setup
Normally, developers use a text editor to write code
Today, we’re using a tool called Codepen
Codepen lets you write HTML/CSS and instantly
see the results of your work
Create an account: http://bit.ly/codepen-account
On second page, skip all the profile information
and just click the big green button at the bottom of
the page
Create a new “pen”
© 2017 Thinkful. All Rights Reserved. 11
Your first website
Copy this (don’t worry if you don’t yet understand):
<html>
<body>
<h1>Hello world!</h1>
</body>
</html>
© 2017 Thinkful. All Rights Reserved. 12
What is HTML?
HTML is the content and
structure of a webpage
© 2017 Thinkful. All Rights Reserved. 13
What is HTML?
© 2017 Thinkful. All Rights Reserved. 14
What is HTML?
© 2017 Thinkful. All Rights Reserved. 15
What is HTML?
HTML is the content and structure of a webpage
Three key concepts:
Tags
Elements
Attributes
© 2017 Thinkful. All Rights Reserved. 16
HTML Tags
Every tag starts with a “less than” sign and ends with a
“greater than” sign
<html> This is an HTML tag
<body> This is a body tag
<h1>Hello world!</h1> This line has two H1
tags, one opening and one closing
</body>
</html>
© 2017 Thinkful. All Rights Reserved. 17
HTML Tags
There are opening tags and closing tags. Closing tags
have a backslash before the tag name.
HTML tags have become more semantic with HTML5
(or, the word signals the purpose of the tag). We’ll
review some common tags shortly.
© 2017 Thinkful. All Rights Reserved. 18
HTML Elements
HTML elements usually consist of an opening tag, closing tag,
and some content.
<html>
<body> This element starts here and ends two lines below
<h1>Hello world!</h1> This is an HTML element
</body>
</html>
Some consist of just a self-closing tag
<img src=“http://i.imgur.com/Th5404r.jpg">
© 2017 Thinkful. All Rights Reserved. 19
HTML Elements
A non-exhaustive list of HTML elements:
<html> HTML tags wrap your entire page
<head> Head tags
<body> Body tags
<h1> H1 tags signify the largest headline. H2
signifies subhead… through h6
<p> Paragraph tags wrap a paragraph of writing
© 2017 Thinkful. All Rights Reserved. 20
HTML Elements
<section> Section tags help you organize different
sections of your layout
<div> Div tags are generic/non-semantic container tags
for anything that needs a container
<a> Anchor tags are for setting some text to be a link
<ul> <li> / <ol><li> Unordered list and ordered lists are
for lists of items, containing list item elements
<button> This is a button
© 2017 Thinkful. All Rights Reserved. 21
HTML Attributes
HTML attributes set properties on an element. They belong in
the opening tag. Here are three common attributes:
<a href=“https://somewhere.com">This is a link</a> href
is an attribute for setting the destination of a link
<h1 class=“headline”>This is a headline</h1> class is an
attribute that doesn’t show up in the rendered webpage,
but will be important when we start talking about CSS
<h1 id=“headline”>This is a headline</h1> id is an
attribute that doesn’t show up in the rendered webpage,
but will be important when we start talking about CSS
© 2017 Thinkful. All Rights Reserved. 22
About me website
bit.ly/codepen-about-me
Let’s walk through the starter code together
Drill: Add another paragraph about yourself
Drill: Add another section to the website similar to the
“About me” section called “About my family” with a
paragraph of lorem ipsum below it
© 2017 Thinkful. All Rights Reserved. 23
HTML Drills
Link here, link there: bit.ly/codepen-link
Images 101: bit.ly/codepen-images
Creating headers: bit.ly/codepen-headers
Add a header element inside of the body (but before the
main content). Inside the header, add a title ("Lorem Ipsum")
on one line, followed by a subtitle on the next ("Holding
places since the 1st century BCE"). The subtitle text should be
smaller than the title text.
Link here, link there solution: bit.ly/codepen-link-solution
Images 101 solution: bit.ly/codepen-images-solution
Creating headers: bit.ly/codepen-headers-solution
© 2017 Thinkful. All Rights Reserved. 24
HTML review
What is HTML?
Tags
Elements
Attributes
Googling HTML elements
© 2017 Thinkful. All Rights Reserved. 25
What is CSS?
Cascading Style Sheets determine the visual
presentation of your HTML webpages
© 2017 Thinkful. All Rights Reserved. 26
What is CSS?
Key concepts:
Selectors
Property
Value
Two problems we solve with CSS:
Presentation of specific elements
Layout
© 2017 Thinkful. All Rights Reserved. 27
CSS Example
h1 {
color: red;
font-size: 36px;
}
© 2017 Thinkful. All Rights Reserved. 28
CSS Selectors
CSS selectors determine which HTML elements are targeted
for specific styles:
p This selects all paragraph tags
.header This selects HTML elements with the class
“header”
#navigation This selects HTML elements with the ID
navigation
p.header This selects paragraph tags with the header
class
Selectors can be combined.
© 2017 Thinkful. All Rights Reserved. 29
CSS Properties
CSS properties determine what about the appearance
you’re setting:
color This determines the font color
font-family This lets you set the typeface as well as
backup typefaces
background-image This lets you set a background
image for an element
height This lets you set the height of an element
© 2017 Thinkful. All Rights Reserved. 30
CSS Properties
Each property has a default value for a given element.
When you write CSS, you over-ride that default value
with a new value.
For a full list, see: http://www.htmldog.com/references/
css/properties/
© 2017 Thinkful. All Rights Reserved. 31
CSS Values
Each property has a set of acceptable values that you can set:
color: red, blue, green, #CCCCCC These are all acceptable
values for the color property
font-family: helvetica, arial, sans-serif These are all acceptable
values for the font-family property
background-image: url("imageFile.jpg") This property looks
for a URL value that points to a specific image file
height: 40px 50% Height can be set as an explicit width or as
a percentage of the containing box
Click on a property to see the acceptable values: http://
www.htmldog.com/references/css/properties/
© 2017 Thinkful. All Rights Reserved. 32
CSS Example
h1 {
color: red;
font-size: 36px;
}
This is a declaration block, containing two declarations:
© 2017 Thinkful. All Rights Reserved. 33
CSS Target Practice
Classes drill: Add classes to the two divs to create a
blue box and a red box, as described in the code
comments and paragraphs in the codepen. You’ll need
to use background-color, margin-bottom, and border.
bit.ly/codepen-classes
Selector drill: write one ruleset for sections that gives
them a margin-bottom of 90px, and a second ruleset
for header elements that sets font-family to Helvetica
bit.ly/codepen-selectors
© 2017 Thinkful. All Rights Reserved. 34
Linking CSS to HTML
We don’t have to deal with this thanks to Codepen
Normally you’d have one HTML file for each webpage
(for example, home.html and profile.html), and a single
CSS file for the whole website’s styles (styles.css)
To link your stylesheet to your HTML, you’d insert the
following line into the <head> section of your HTML
webpage:
<link rel="stylesheet" type="text/css"
href="theme.css">
© 2017 Thinkful. All Rights Reserved. 35
CSS Layout
CSS layout determines how elements are arranged around each other. For
example, Facebook wrote styles to make the nav bar stick to the top, have the
pages and favorites section on the left and the news feed run down the center:
© 2017 Thinkful. All Rights Reserved. 36
CSS Layout
Key concepts:
Display: inline vs display: block
The box model
Position property
© 2017 Thinkful. All Rights Reserved. 37
In-line vs block
Every element has a display property set to in-line or
block.
A block-level element always starts on a new line
and stretches to the full width available
An inline element does not start on a new line and
only takes up as much width as necessary
Every element has a default value, and that value can
be over-ridden by setting an explicit value.
© 2017 Thinkful. All Rights Reserved. 38
In-line vs block
For a full list of inline elements, see: https://
developer.mozilla.org/en-US/docs/Web/HTML/
Inline_elements
For a full list of block-level elements, see: https://
developer.mozilla.org/en-US/docs/Web/HTML/Block-
level_elements
© 2017 Thinkful. All Rights Reserved. 39
The box model & position property
Elements are boxes. We use the position property to organize
these elements/boxes around each other. The position property
has four values:
Static: normal flow. Block elements stack on top of each other.
Inline elements are as large as the content they contain.
Fixed: outside of normal flow. Stays in same place no matter
what.
Relative: normal flow. Unlike static, can use left, right, top,
bottom properties to move the elements around relative to
where they’d otherwise sit.
Absolute: outside of normal flow. Stays in a specific spot on a
page.
© 2017 Thinkful. All Rights Reserved. 40
Static positioning
Example: bit.ly/codepen-static
© 2017 Thinkful. All Rights Reserved. 41
Fixed positioning
Example: bit.ly/codepen-fixed
© 2017 Thinkful. All Rights Reserved. 42
Relative positioning
Example: bit.ly/codepen-relative
What happens if I change relative to static?
© 2017 Thinkful. All Rights Reserved. 43
Absolute positioning
Example: bit.ly/codepen-absolute
You’ll be tempted to use absolute
positioning to jerry-rig a design. Don’t do
this. Only use it when you’re working within a
small div that’s not going to change a lot.
© 2017 Thinkful. All Rights Reserved. 44
Positioning exercise
Note: we likely will not have time for this tonight.
Build this layout:
© 2017 Thinkful. All Rights Reserved. 45
Positioning exercise
© 2017 Thinkful. All Rights Reserved. 46
Positioning exercise: Reasoning about Layout
Images can be downloaded from here: bit.ly/catdog-images
Steps:
Break the page down into its components
Pick one to start with (top to bottom, left to right)
List the elements inside of a component
Identify if a given element should be inline or block, and pick the
most appropriate HTML element
Code the first element (once again, top to bottom, left to right)
Trick: put a 1px red box around every element with “* {border: 1px
solid red; }”. That will let you visualize the boxes of elements more
effectively.
© 2017 Thinkful. All Rights Reserved. 47
Where to go from here
More practice… especially with layout
Forms and input
Responsive design
Developer tools
JavaScript for interactivity
© 2017 Thinkful. All Rights Reserved. 48
Learn to learn
Google is your friend
Practice at the edge of your abilities
For HTML/CSS, that usually means picking a
webpage and copying it
Don’t know where to start? Start with Craigslist.
Then do Reddit. Then do Twitter.
For HTML/CSS you don’t need tons of tutorials.
Ignore the hot new thing. Once you’ve started building
something, see it through.
© 2017 Thinkful. All Rights Reserved. 49
Take-home challenges
Finish the positioning exercise
Build a resume with semantic HTML
Take this page and code your own version of it: https://
thinkful-ed.github.io/gregs-list/
© 2017 Thinkful. All Rights Reserved. 50
More about Thinkful
Work 1-on-1 with a mentor (like me!) in a 6-month part-
time program or 5-month full-time program
Learn Full stack web development and computer
science fundamentals, and then work with a career
coach during the job search phase
Go beyond the basics by building projects for your
own portfolio
© 2017 Thinkful. All Rights Reserved. 51
You’ll learn concepts, practice with drills, and build capstone projects
for your own portfolio — all with 1-on-1 feedback from a mentor
More about Thinkful
© 2017 Thinkful. All Rights Reserved. 52
Outcomes
Job Titles after GraduationMonths until Employed
© 2017 Thinkful. All Rights Reserved. 53
Special promo
Try the 6-month program for two weeks for $50
Learn HTML/CSS and JavaScript
Continue into web development bootcamp
Talk to me or Dan (or email either of us) to gain access
Thank you!
Email Dan: dan@thinkful.com
Email me: dcoulter@thinkful.com
April 2017

More Related Content

What's hot (20)

Object Oriented Javascript
Object Oriented JavascriptObject Oriented Javascript
Object Oriented Javascript
NexThoughts Technologies
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
Seble Nigussie
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
Alfredo Torre
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
Amit Tyagi
 
PHP
PHPPHP
PHP
Steve Fort
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricks
Ashokkumar T A
 
Bootstrap 5 basic
Bootstrap 5 basicBootstrap 5 basic
Bootstrap 5 basic
Jubair Ahmed Junjun
 
React-JS Component Life-cycle Methods
React-JS Component Life-cycle MethodsReact-JS Component Life-cycle Methods
React-JS Component Life-cycle Methods
ANKUSH CHAVAN
 
Sessions in php
Sessions in php Sessions in php
Sessions in php
Mudasir Syed
 
Javascript and DOM
Javascript and DOMJavascript and DOM
Javascript and DOM
Brian Moschel
 
Introducing CSS Grid
Introducing CSS GridIntroducing CSS Grid
Introducing CSS Grid
Jason Yingling
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
Syed Sami
 
AEM Sightly Deep Dive
AEM Sightly Deep DiveAEM Sightly Deep Dive
AEM Sightly Deep Dive
Gabriel Walt
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
Sun Technlogies
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
Russ Weakley
 
ReactJS
ReactJSReactJS
ReactJS
Hiten Pratap Singh
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
Seble Nigussie
 
Css position
Css positionCss position
Css position
Webtech Learning
 
Css Display Property
Css Display PropertyCss Display Property
Css Display Property
Webtech Learning
 
Css
CssCss
Css
Hemant Saini
 

Viewers also liked (20)

CSS3 Introduction
CSS3 IntroductionCSS3 Introduction
CSS3 Introduction
Jaeni Sahuri
 
Fleet & transport policy - Envision International (Conf 2010)
Fleet & transport policy - Envision International (Conf 2010)Fleet & transport policy - Envision International (Conf 2010)
Fleet & transport policy - Envision International (Conf 2010)
Andre Knipe
 
Basic Transport & Fleet Mngt - AK2015
Basic Transport & Fleet Mngt - AK2015Basic Transport & Fleet Mngt - AK2015
Basic Transport & Fleet Mngt - AK2015
Andre Knipe
 
Vehicle Management Software
Vehicle Management SoftwareVehicle Management Software
Vehicle Management Software
Tracey Billings
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
Doris Chen
 
Building a game with JavaScript (March 2017, washington dc)
Building a game with JavaScript (March 2017, washington dc)Building a game with JavaScript (March 2017, washington dc)
Building a game with JavaScript (March 2017, washington dc)
Daniel Friedman
 
Fleet management system
Fleet management systemFleet management system
Fleet management system
Shree Deepam Infotech Pvt. Ltd.
 
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopModular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
Shay Howe
 
Vehicle Information System
Vehicle Information SystemVehicle Information System
Vehicle Information System
Rajan Kandel
 
CSS Inlining in Email: What It IS + How To Do It
CSS Inlining in Email: What It IS + How To Do ItCSS Inlining in Email: What It IS + How To Do It
CSS Inlining in Email: What It IS + How To Do It
Litmus
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Ferdous Mahmud Shaon
 
10 Strategies for Resolving Common Fleet Management Challenges
10 Strategies for Resolving Common Fleet Management Challenges10 Strategies for Resolving Common Fleet Management Challenges
10 Strategies for Resolving Common Fleet Management Challenges
AssetWorks
 
VMS
VMSVMS
VMS
assetTL
 
Vehicle Management Information System
Vehicle Management Information SystemVehicle Management Information System
Vehicle Management Information System
Mohammad Reza Tanvir Shahrear
 
Vehicle tracker & fleet management system ver 1.0
Vehicle tracker & fleet management system ver 1.0 Vehicle tracker & fleet management system ver 1.0
Vehicle tracker & fleet management system ver 1.0
Ato Wilberforce
 
VEHICLE MANAGEMENT SYSTEM
VEHICLE MANAGEMENT SYSTEMVEHICLE MANAGEMENT SYSTEM
VEHICLE MANAGEMENT SYSTEM
Akash Koul
 
The 6 Key Elements of Vehicle Fleet Management
The 6 Key Elements of Vehicle Fleet ManagementThe 6 Key Elements of Vehicle Fleet Management
The 6 Key Elements of Vehicle Fleet Management
Sadashiv Borgaonkar
 
Fleet Management System
Fleet Management SystemFleet Management System
Fleet Management System
lontongcorp
 
Fleet Management Basics
Fleet Management BasicsFleet Management Basics
Fleet Management Basics
jcade75834
 
CSS Systems
CSS SystemsCSS Systems
CSS Systems
Natalie Downe
 
Fleet & transport policy - Envision International (Conf 2010)
Fleet & transport policy - Envision International (Conf 2010)Fleet & transport policy - Envision International (Conf 2010)
Fleet & transport policy - Envision International (Conf 2010)
Andre Knipe
 
Basic Transport & Fleet Mngt - AK2015
Basic Transport & Fleet Mngt - AK2015Basic Transport & Fleet Mngt - AK2015
Basic Transport & Fleet Mngt - AK2015
Andre Knipe
 
Vehicle Management Software
Vehicle Management SoftwareVehicle Management Software
Vehicle Management Software
Tracey Billings
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
Doris Chen
 
Building a game with JavaScript (March 2017, washington dc)
Building a game with JavaScript (March 2017, washington dc)Building a game with JavaScript (March 2017, washington dc)
Building a game with JavaScript (March 2017, washington dc)
Daniel Friedman
 
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopModular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
Shay Howe
 
Vehicle Information System
Vehicle Information SystemVehicle Information System
Vehicle Information System
Rajan Kandel
 
CSS Inlining in Email: What It IS + How To Do It
CSS Inlining in Email: What It IS + How To Do ItCSS Inlining in Email: What It IS + How To Do It
CSS Inlining in Email: What It IS + How To Do It
Litmus
 
10 Strategies for Resolving Common Fleet Management Challenges
10 Strategies for Resolving Common Fleet Management Challenges10 Strategies for Resolving Common Fleet Management Challenges
10 Strategies for Resolving Common Fleet Management Challenges
AssetWorks
 
Vehicle tracker & fleet management system ver 1.0
Vehicle tracker & fleet management system ver 1.0 Vehicle tracker & fleet management system ver 1.0
Vehicle tracker & fleet management system ver 1.0
Ato Wilberforce
 
VEHICLE MANAGEMENT SYSTEM
VEHICLE MANAGEMENT SYSTEMVEHICLE MANAGEMENT SYSTEM
VEHICLE MANAGEMENT SYSTEM
Akash Koul
 
The 6 Key Elements of Vehicle Fleet Management
The 6 Key Elements of Vehicle Fleet ManagementThe 6 Key Elements of Vehicle Fleet Management
The 6 Key Elements of Vehicle Fleet Management
Sadashiv Borgaonkar
 
Fleet Management System
Fleet Management SystemFleet Management System
Fleet Management System
lontongcorp
 
Fleet Management Basics
Fleet Management BasicsFleet Management Basics
Fleet Management Basics
jcade75834
 

Similar to HTML/CSS Crash Course (april 4 2017) (20)

Thinkful - HTML/CSS Crash Course (May 4 2017)
Thinkful - HTML/CSS Crash Course (May 4 2017)Thinkful - HTML/CSS Crash Course (May 4 2017)
Thinkful - HTML/CSS Crash Course (May 4 2017)
TJ Stalcup
 
Frontend Crash Course: HTML and CSS
Frontend Crash Course: HTML and CSSFrontend Crash Course: HTML and CSS
Frontend Crash Course: HTML and CSS
Thinkful
 
Code & Design your first website 4/18
Code & Design your first website 4/18Code & Design your first website 4/18
Code & Design your first website 4/18
TJ Stalcup
 
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)
Thinkful
 
Html:css crash course (4:5)
Html:css crash course (4:5)Html:css crash course (4:5)
Html:css crash course (4:5)
Thinkful
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSS
TJ Stalcup
 
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
 
Code & Design Your First Website (Downtown Los Angeles)
Code & Design Your First Website (Downtown Los Angeles)Code & Design Your First Website (Downtown Los Angeles)
Code & Design Your First Website (Downtown Los Angeles)
Thinkful
 
Design for developers (april 25, 2017)
Design for developers (april 25, 2017)Design for developers (april 25, 2017)
Design for developers (april 25, 2017)
Thinkful
 
Fccwc326
Fccwc326Fccwc326
Fccwc326
Shannon Gallagher
 
Tfbyoweb.4.9.17
Tfbyoweb.4.9.17Tfbyoweb.4.9.17
Tfbyoweb.4.9.17
Jordan Zurowski
 
Tfbyoweb.4.9.17
Tfbyoweb.4.9.17Tfbyoweb.4.9.17
Tfbyoweb.4.9.17
Jordan Zurowski
 
Web Design & Development - Session 2
Web Design & Development - Session 2Web Design & Development - Session 2
Web Design & Development - Session 2
Shahrzad Peyman
 
Rapid HTML Prototyping with Bootstrap 4
Rapid HTML Prototyping with Bootstrap 4Rapid HTML Prototyping with Bootstrap 4
Rapid HTML Prototyping with Bootstrap 4
UXPA International
 
Introduction to Web Technology and Web Page Development
Introduction to Web Technology and Web Page DevelopmentIntroduction to Web Technology and Web Page Development
Introduction to Web Technology and Web Page Development
BhargaviDalal4
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
KADAMBARIPUROHIT
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
AliRaza899305
 
HTML+CSS: how to get started
HTML+CSS: how to get startedHTML+CSS: how to get started
HTML+CSS: how to get started
Dimitris Tsironis
 
gdg Introduction to HTML-CSS-Javascript.pptx
gdg Introduction to HTML-CSS-Javascript.pptxgdg Introduction to HTML-CSS-Javascript.pptx
gdg Introduction to HTML-CSS-Javascript.pptx
saurabh45tiwari
 
Introduction to HTML-CSS-Javascript.pptx
Introduction to HTML-CSS-Javascript.pptxIntroduction to HTML-CSS-Javascript.pptx
Introduction to HTML-CSS-Javascript.pptx
deepak37877
 
Thinkful - HTML/CSS Crash Course (May 4 2017)
Thinkful - HTML/CSS Crash Course (May 4 2017)Thinkful - HTML/CSS Crash Course (May 4 2017)
Thinkful - HTML/CSS Crash Course (May 4 2017)
TJ Stalcup
 
Frontend Crash Course: HTML and CSS
Frontend Crash Course: HTML and CSSFrontend Crash Course: HTML and CSS
Frontend Crash Course: HTML and CSS
Thinkful
 
Code & Design your first website 4/18
Code & Design your first website 4/18Code & Design your first website 4/18
Code & Design your first website 4/18
TJ Stalcup
 
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)
Thinkful
 
Html:css crash course (4:5)
Html:css crash course (4:5)Html:css crash course (4:5)
Html:css crash course (4:5)
Thinkful
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSS
TJ Stalcup
 
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
 
Code & Design Your First Website (Downtown Los Angeles)
Code & Design Your First Website (Downtown Los Angeles)Code & Design Your First Website (Downtown Los Angeles)
Code & Design Your First Website (Downtown Los Angeles)
Thinkful
 
Design for developers (april 25, 2017)
Design for developers (april 25, 2017)Design for developers (april 25, 2017)
Design for developers (april 25, 2017)
Thinkful
 
Web Design & Development - Session 2
Web Design & Development - Session 2Web Design & Development - Session 2
Web Design & Development - Session 2
Shahrzad Peyman
 
Rapid HTML Prototyping with Bootstrap 4
Rapid HTML Prototyping with Bootstrap 4Rapid HTML Prototyping with Bootstrap 4
Rapid HTML Prototyping with Bootstrap 4
UXPA International
 
Introduction to Web Technology and Web Page Development
Introduction to Web Technology and Web Page DevelopmentIntroduction to Web Technology and Web Page Development
Introduction to Web Technology and Web Page Development
BhargaviDalal4
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
KADAMBARIPUROHIT
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
AliRaza899305
 
HTML+CSS: how to get started
HTML+CSS: how to get startedHTML+CSS: how to get started
HTML+CSS: how to get started
Dimitris Tsironis
 
gdg Introduction to HTML-CSS-Javascript.pptx
gdg Introduction to HTML-CSS-Javascript.pptxgdg Introduction to HTML-CSS-Javascript.pptx
gdg Introduction to HTML-CSS-Javascript.pptx
saurabh45tiwari
 
Introduction to HTML-CSS-Javascript.pptx
Introduction to HTML-CSS-Javascript.pptxIntroduction to HTML-CSS-Javascript.pptx
Introduction to HTML-CSS-Javascript.pptx
deepak37877
 

Recently uploaded (20)

Mental Health and Workplace Culture in Tech:A Personal Perspective
Mental Health and Workplace Culture in Tech:A Personal PerspectiveMental Health and Workplace Culture in Tech:A Personal Perspective
Mental Health and Workplace Culture in Tech:A Personal Perspective
Bangladesh Network Operators Group
 
Strengthening Cyber Security with Tools and Human Expertise
Strengthening Cyber Security with Tools and Human ExpertiseStrengthening Cyber Security with Tools and Human Expertise
Strengthening Cyber Security with Tools and Human Expertise
Bangladesh Network Operators Group
 
IPv6 Mostly Experience at APRICOT by Yoshinobu Matsuzaki (IIJ)
IPv6 Mostly Experience at APRICOT by Yoshinobu Matsuzaki (IIJ)IPv6 Mostly Experience at APRICOT by Yoshinobu Matsuzaki (IIJ)
IPv6 Mostly Experience at APRICOT by Yoshinobu Matsuzaki (IIJ)
Bangladesh Network Operators Group
 
Bsjsudhjsidudjdudjdudidjjdjdkdel-se-br.ppt
Bsjsudhjsidudjdudjdudidjjdjdkdel-se-br.pptBsjsudhjsidudjdudjdudidjjdjdkdel-se-br.ppt
Bsjsudhjsidudjdudjdudidjjdjdkdel-se-br.ppt
ssuserb171f7
 
Navigating Compliance for MSPs From First Audit to Monetization
Navigating Compliance for MSPs From First Audit to MonetizationNavigating Compliance for MSPs From First Audit to Monetization
Navigating Compliance for MSPs From First Audit to Monetization
ControlCase
 
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptxTransport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
ssuser80a7e81
 
Fast Reroute in SR-MPLS by Md Abdullah Al Naser
Fast Reroute in SR-MPLS by Md Abdullah Al NaserFast Reroute in SR-MPLS by Md Abdullah Al Naser
Fast Reroute in SR-MPLS by Md Abdullah Al Naser
Bangladesh Network Operators Group
 
Presentation About The Buttons | Selma SALTIK
Presentation About The Buttons | Selma SALTIKPresentation About The Buttons | Selma SALTIK
Presentation About The Buttons | Selma SALTIK
SELMA SALTIK
 
Mikotik_Load_Balancing_workshop_best_practice
Mikotik_Load_Balancing_workshop_best_practiceMikotik_Load_Balancing_workshop_best_practice
Mikotik_Load_Balancing_workshop_best_practice
davidarmandorodrigue
 
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdf
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdfEssential Tech Stack for Effective Shopify Dropshipping Integration.pdf
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdf
CartCoders
 
The Internet Service Providers and Connectivity Providers of ICANN
The Internet Service Providers and Connectivity Providers of ICANNThe Internet Service Providers and Connectivity Providers of ICANN
The Internet Service Providers and Connectivity Providers of ICANN
Bangladesh Network Operators Group
 
Paper: QFS: World Game (s) Great Redesign.pdf
Paper: QFS: World Game (s) Great Redesign.pdfPaper: QFS: World Game (s) Great Redesign.pdf
Paper: QFS: World Game (s) Great Redesign.pdf
Steven McGee
 
DATA COMMUNICATION components, modes of transmission & communication devices ...
DATA COMMUNICATION components, modes of transmission & communication devices ...DATA COMMUNICATION components, modes of transmission & communication devices ...
DATA COMMUNICATION components, modes of transmission & communication devices ...
samina khan
 
5 Reasons cheap WordPress hosting is costing you more | Reversed Out
5 Reasons cheap WordPress hosting is costing you more | Reversed Out5 Reasons cheap WordPress hosting is costing you more | Reversed Out
5 Reasons cheap WordPress hosting is costing you more | Reversed Out
Reversed Out Creative
 
Network Efficiency:The LLM Advantage on network infrastructures
Network Efficiency:The LLM Advantage on network infrastructuresNetwork Efficiency:The LLM Advantage on network infrastructures
Network Efficiency:The LLM Advantage on network infrastructures
Bangladesh Network Operators Group
 
DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...
DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...
DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...
Bangladesh Network Operators Group
 
Optics101 for non-Optical (IP) folks by Tashi Phuntsho
Optics101 for non-Optical (IP) folks by Tashi PhuntshoOptics101 for non-Optical (IP) folks by Tashi Phuntsho
Optics101 for non-Optical (IP) folks by Tashi Phuntsho
Bangladesh Network Operators Group
 
Unlocking the Power of SIM Card IoT Connectivity.pdf
Unlocking the Power of SIM Card IoT Connectivity.pdfUnlocking the Power of SIM Card IoT Connectivity.pdf
Unlocking the Power of SIM Card IoT Connectivity.pdf
elite virtual staffing solutions
 
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
Taqyea
 
Utilizing Free and open-source Technology and Achieve Next Generation Enterpr...
Utilizing Free and open-source Technology and Achieve Next Generation Enterpr...Utilizing Free and open-source Technology and Achieve Next Generation Enterpr...
Utilizing Free and open-source Technology and Achieve Next Generation Enterpr...
Bangladesh Network Operators Group
 
Mental Health and Workplace Culture in Tech:A Personal Perspective
Mental Health and Workplace Culture in Tech:A Personal PerspectiveMental Health and Workplace Culture in Tech:A Personal Perspective
Mental Health and Workplace Culture in Tech:A Personal Perspective
Bangladesh Network Operators Group
 
IPv6 Mostly Experience at APRICOT by Yoshinobu Matsuzaki (IIJ)
IPv6 Mostly Experience at APRICOT by Yoshinobu Matsuzaki (IIJ)IPv6 Mostly Experience at APRICOT by Yoshinobu Matsuzaki (IIJ)
IPv6 Mostly Experience at APRICOT by Yoshinobu Matsuzaki (IIJ)
Bangladesh Network Operators Group
 
Bsjsudhjsidudjdudjdudidjjdjdkdel-se-br.ppt
Bsjsudhjsidudjdudjdudidjjdjdkdel-se-br.pptBsjsudhjsidudjdudjdudidjjdjdkdel-se-br.ppt
Bsjsudhjsidudjdudjdudidjjdjdkdel-se-br.ppt
ssuserb171f7
 
Navigating Compliance for MSPs From First Audit to Monetization
Navigating Compliance for MSPs From First Audit to MonetizationNavigating Compliance for MSPs From First Audit to Monetization
Navigating Compliance for MSPs From First Audit to Monetization
ControlCase
 
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptxTransport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
ssuser80a7e81
 
Presentation About The Buttons | Selma SALTIK
Presentation About The Buttons | Selma SALTIKPresentation About The Buttons | Selma SALTIK
Presentation About The Buttons | Selma SALTIK
SELMA SALTIK
 
Mikotik_Load_Balancing_workshop_best_practice
Mikotik_Load_Balancing_workshop_best_practiceMikotik_Load_Balancing_workshop_best_practice
Mikotik_Load_Balancing_workshop_best_practice
davidarmandorodrigue
 
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdf
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdfEssential Tech Stack for Effective Shopify Dropshipping Integration.pdf
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdf
CartCoders
 
The Internet Service Providers and Connectivity Providers of ICANN
The Internet Service Providers and Connectivity Providers of ICANNThe Internet Service Providers and Connectivity Providers of ICANN
The Internet Service Providers and Connectivity Providers of ICANN
Bangladesh Network Operators Group
 
Paper: QFS: World Game (s) Great Redesign.pdf
Paper: QFS: World Game (s) Great Redesign.pdfPaper: QFS: World Game (s) Great Redesign.pdf
Paper: QFS: World Game (s) Great Redesign.pdf
Steven McGee
 
DATA COMMUNICATION components, modes of transmission & communication devices ...
DATA COMMUNICATION components, modes of transmission & communication devices ...DATA COMMUNICATION components, modes of transmission & communication devices ...
DATA COMMUNICATION components, modes of transmission & communication devices ...
samina khan
 
5 Reasons cheap WordPress hosting is costing you more | Reversed Out
5 Reasons cheap WordPress hosting is costing you more | Reversed Out5 Reasons cheap WordPress hosting is costing you more | Reversed Out
5 Reasons cheap WordPress hosting is costing you more | Reversed Out
Reversed Out Creative
 
Network Efficiency:The LLM Advantage on network infrastructures
Network Efficiency:The LLM Advantage on network infrastructuresNetwork Efficiency:The LLM Advantage on network infrastructures
Network Efficiency:The LLM Advantage on network infrastructures
Bangladesh Network Operators Group
 
DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...
DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...
DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...
Bangladesh Network Operators Group
 
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
Taqyea
 
Utilizing Free and open-source Technology and Achieve Next Generation Enterpr...
Utilizing Free and open-source Technology and Achieve Next Generation Enterpr...Utilizing Free and open-source Technology and Achieve Next Generation Enterpr...
Utilizing Free and open-source Technology and Achieve Next Generation Enterpr...
Bangladesh Network Operators Group
 

HTML/CSS Crash Course (april 4 2017)

  • 1. Frontend Crash Course: Intro to HTML/CSS Access the slides: bit.ly/dc-html
  • 2. © 2017 Thinkful. All Rights Reserved. 2 About me David Coulter Frontend developer and product manager for 10 years at National Geographic, NGP Van, Arcadia Power Mentor @ Thinkful
  • 3. © 2017 Thinkful. All Rights Reserved. 3 About you Why are you here? Do you want to work better with developers? Do you want to start working in tech? Do you have an idea that you want to build? Programming experience? First lines of code will be written tonight? Been self teaching for 1-3 months? Been at this for 3+ months
  • 4. © 2017 Thinkful. All Rights Reserved. 4 Goals Learn core concepts of HTML/CSS to build websites Complete drills to put those concepts into practice Build your first website Get comfortable with the feeling of learning programming, especially struggling with a concept Take home challenges to keep going
  • 5. © 2017 Thinkful. All Rights Reserved. 5 How the web works Type a URL from a client (e.g. google.com) Browser communicates with DNS server to find IP address Browser sends an HTTP request asking for specific files Browser receives those files and renders them as a website
  • 6. © 2017 Thinkful. All Rights Reserved. 6 Client / Server Client Frontend Developer Server Backend Developer
  • 7. © 2017 Thinkful. All Rights Reserved. 7 Client / Server Request Response Client - UI Logic Server - Business Logic Database Servers
  • 8. © 2017 Thinkful. All Rights Reserved. 8 Example: Facebook HTML, CSS, & Javascript render interactive newsfeed Algorithm determines what’s in your feed Request Get data about your friends and their posts Open browser and navigate to facebook.com Business Logic Database Servers Response
  • 9. © 2017 Thinkful. All Rights Reserved. 9 How that relates to what we’re doing When we write HTML & CSS today, we are creating those files that are stored on a server, sent through a series of tubes, and then rendered by your browser
  • 10. © 2017 Thinkful. All Rights Reserved. 10 Setup Normally, developers use a text editor to write code Today, we’re using a tool called Codepen Codepen lets you write HTML/CSS and instantly see the results of your work Create an account: http://bit.ly/codepen-account On second page, skip all the profile information and just click the big green button at the bottom of the page Create a new “pen”
  • 11. © 2017 Thinkful. All Rights Reserved. 11 Your first website Copy this (don’t worry if you don’t yet understand): <html> <body> <h1>Hello world!</h1> </body> </html>
  • 12. © 2017 Thinkful. All Rights Reserved. 12 What is HTML? HTML is the content and structure of a webpage
  • 13. © 2017 Thinkful. All Rights Reserved. 13 What is HTML?
  • 14. © 2017 Thinkful. All Rights Reserved. 14 What is HTML?
  • 15. © 2017 Thinkful. All Rights Reserved. 15 What is HTML? HTML is the content and structure of a webpage Three key concepts: Tags Elements Attributes
  • 16. © 2017 Thinkful. All Rights Reserved. 16 HTML Tags Every tag starts with a “less than” sign and ends with a “greater than” sign <html> This is an HTML tag <body> This is a body tag <h1>Hello world!</h1> This line has two H1 tags, one opening and one closing </body> </html>
  • 17. © 2017 Thinkful. All Rights Reserved. 17 HTML Tags There are opening tags and closing tags. Closing tags have a backslash before the tag name. HTML tags have become more semantic with HTML5 (or, the word signals the purpose of the tag). We’ll review some common tags shortly.
  • 18. © 2017 Thinkful. All Rights Reserved. 18 HTML Elements HTML elements usually consist of an opening tag, closing tag, and some content. <html> <body> This element starts here and ends two lines below <h1>Hello world!</h1> This is an HTML element </body> </html> Some consist of just a self-closing tag <img src=“http://i.imgur.com/Th5404r.jpg">
  • 19. © 2017 Thinkful. All Rights Reserved. 19 HTML Elements A non-exhaustive list of HTML elements: <html> HTML tags wrap your entire page <head> Head tags <body> Body tags <h1> H1 tags signify the largest headline. H2 signifies subhead… through h6 <p> Paragraph tags wrap a paragraph of writing
  • 20. © 2017 Thinkful. All Rights Reserved. 20 HTML Elements <section> Section tags help you organize different sections of your layout <div> Div tags are generic/non-semantic container tags for anything that needs a container <a> Anchor tags are for setting some text to be a link <ul> <li> / <ol><li> Unordered list and ordered lists are for lists of items, containing list item elements <button> This is a button
  • 21. © 2017 Thinkful. All Rights Reserved. 21 HTML Attributes HTML attributes set properties on an element. They belong in the opening tag. Here are three common attributes: <a href=“https://somewhere.com">This is a link</a> href is an attribute for setting the destination of a link <h1 class=“headline”>This is a headline</h1> class is an attribute that doesn’t show up in the rendered webpage, but will be important when we start talking about CSS <h1 id=“headline”>This is a headline</h1> id is an attribute that doesn’t show up in the rendered webpage, but will be important when we start talking about CSS
  • 22. © 2017 Thinkful. All Rights Reserved. 22 About me website bit.ly/codepen-about-me Let’s walk through the starter code together Drill: Add another paragraph about yourself Drill: Add another section to the website similar to the “About me” section called “About my family” with a paragraph of lorem ipsum below it
  • 23. © 2017 Thinkful. All Rights Reserved. 23 HTML Drills Link here, link there: bit.ly/codepen-link Images 101: bit.ly/codepen-images Creating headers: bit.ly/codepen-headers Add a header element inside of the body (but before the main content). Inside the header, add a title ("Lorem Ipsum") on one line, followed by a subtitle on the next ("Holding places since the 1st century BCE"). The subtitle text should be smaller than the title text. Link here, link there solution: bit.ly/codepen-link-solution Images 101 solution: bit.ly/codepen-images-solution Creating headers: bit.ly/codepen-headers-solution
  • 24. © 2017 Thinkful. All Rights Reserved. 24 HTML review What is HTML? Tags Elements Attributes Googling HTML elements
  • 25. © 2017 Thinkful. All Rights Reserved. 25 What is CSS? Cascading Style Sheets determine the visual presentation of your HTML webpages
  • 26. © 2017 Thinkful. All Rights Reserved. 26 What is CSS? Key concepts: Selectors Property Value Two problems we solve with CSS: Presentation of specific elements Layout
  • 27. © 2017 Thinkful. All Rights Reserved. 27 CSS Example h1 { color: red; font-size: 36px; }
  • 28. © 2017 Thinkful. All Rights Reserved. 28 CSS Selectors CSS selectors determine which HTML elements are targeted for specific styles: p This selects all paragraph tags .header This selects HTML elements with the class “header” #navigation This selects HTML elements with the ID navigation p.header This selects paragraph tags with the header class Selectors can be combined.
  • 29. © 2017 Thinkful. All Rights Reserved. 29 CSS Properties CSS properties determine what about the appearance you’re setting: color This determines the font color font-family This lets you set the typeface as well as backup typefaces background-image This lets you set a background image for an element height This lets you set the height of an element
  • 30. © 2017 Thinkful. All Rights Reserved. 30 CSS Properties Each property has a default value for a given element. When you write CSS, you over-ride that default value with a new value. For a full list, see: http://www.htmldog.com/references/ css/properties/
  • 31. © 2017 Thinkful. All Rights Reserved. 31 CSS Values Each property has a set of acceptable values that you can set: color: red, blue, green, #CCCCCC These are all acceptable values for the color property font-family: helvetica, arial, sans-serif These are all acceptable values for the font-family property background-image: url("imageFile.jpg") This property looks for a URL value that points to a specific image file height: 40px 50% Height can be set as an explicit width or as a percentage of the containing box Click on a property to see the acceptable values: http:// www.htmldog.com/references/css/properties/
  • 32. © 2017 Thinkful. All Rights Reserved. 32 CSS Example h1 { color: red; font-size: 36px; } This is a declaration block, containing two declarations:
  • 33. © 2017 Thinkful. All Rights Reserved. 33 CSS Target Practice Classes drill: Add classes to the two divs to create a blue box and a red box, as described in the code comments and paragraphs in the codepen. You’ll need to use background-color, margin-bottom, and border. bit.ly/codepen-classes Selector drill: write one ruleset for sections that gives them a margin-bottom of 90px, and a second ruleset for header elements that sets font-family to Helvetica bit.ly/codepen-selectors
  • 34. © 2017 Thinkful. All Rights Reserved. 34 Linking CSS to HTML We don’t have to deal with this thanks to Codepen Normally you’d have one HTML file for each webpage (for example, home.html and profile.html), and a single CSS file for the whole website’s styles (styles.css) To link your stylesheet to your HTML, you’d insert the following line into the <head> section of your HTML webpage: <link rel="stylesheet" type="text/css" href="theme.css">
  • 35. © 2017 Thinkful. All Rights Reserved. 35 CSS Layout CSS layout determines how elements are arranged around each other. For example, Facebook wrote styles to make the nav bar stick to the top, have the pages and favorites section on the left and the news feed run down the center:
  • 36. © 2017 Thinkful. All Rights Reserved. 36 CSS Layout Key concepts: Display: inline vs display: block The box model Position property
  • 37. © 2017 Thinkful. All Rights Reserved. 37 In-line vs block Every element has a display property set to in-line or block. A block-level element always starts on a new line and stretches to the full width available An inline element does not start on a new line and only takes up as much width as necessary Every element has a default value, and that value can be over-ridden by setting an explicit value.
  • 38. © 2017 Thinkful. All Rights Reserved. 38 In-line vs block For a full list of inline elements, see: https:// developer.mozilla.org/en-US/docs/Web/HTML/ Inline_elements For a full list of block-level elements, see: https:// developer.mozilla.org/en-US/docs/Web/HTML/Block- level_elements
  • 39. © 2017 Thinkful. All Rights Reserved. 39 The box model & position property Elements are boxes. We use the position property to organize these elements/boxes around each other. The position property has four values: Static: normal flow. Block elements stack on top of each other. Inline elements are as large as the content they contain. Fixed: outside of normal flow. Stays in same place no matter what. Relative: normal flow. Unlike static, can use left, right, top, bottom properties to move the elements around relative to where they’d otherwise sit. Absolute: outside of normal flow. Stays in a specific spot on a page.
  • 40. © 2017 Thinkful. All Rights Reserved. 40 Static positioning Example: bit.ly/codepen-static
  • 41. © 2017 Thinkful. All Rights Reserved. 41 Fixed positioning Example: bit.ly/codepen-fixed
  • 42. © 2017 Thinkful. All Rights Reserved. 42 Relative positioning Example: bit.ly/codepen-relative What happens if I change relative to static?
  • 43. © 2017 Thinkful. All Rights Reserved. 43 Absolute positioning Example: bit.ly/codepen-absolute You’ll be tempted to use absolute positioning to jerry-rig a design. Don’t do this. Only use it when you’re working within a small div that’s not going to change a lot.
  • 44. © 2017 Thinkful. All Rights Reserved. 44 Positioning exercise Note: we likely will not have time for this tonight. Build this layout:
  • 45. © 2017 Thinkful. All Rights Reserved. 45 Positioning exercise
  • 46. © 2017 Thinkful. All Rights Reserved. 46 Positioning exercise: Reasoning about Layout Images can be downloaded from here: bit.ly/catdog-images Steps: Break the page down into its components Pick one to start with (top to bottom, left to right) List the elements inside of a component Identify if a given element should be inline or block, and pick the most appropriate HTML element Code the first element (once again, top to bottom, left to right) Trick: put a 1px red box around every element with “* {border: 1px solid red; }”. That will let you visualize the boxes of elements more effectively.
  • 47. © 2017 Thinkful. All Rights Reserved. 47 Where to go from here More practice… especially with layout Forms and input Responsive design Developer tools JavaScript for interactivity
  • 48. © 2017 Thinkful. All Rights Reserved. 48 Learn to learn Google is your friend Practice at the edge of your abilities For HTML/CSS, that usually means picking a webpage and copying it Don’t know where to start? Start with Craigslist. Then do Reddit. Then do Twitter. For HTML/CSS you don’t need tons of tutorials. Ignore the hot new thing. Once you’ve started building something, see it through.
  • 49. © 2017 Thinkful. All Rights Reserved. 49 Take-home challenges Finish the positioning exercise Build a resume with semantic HTML Take this page and code your own version of it: https:// thinkful-ed.github.io/gregs-list/
  • 50. © 2017 Thinkful. All Rights Reserved. 50 More about Thinkful Work 1-on-1 with a mentor (like me!) in a 6-month part- time program or 5-month full-time program Learn Full stack web development and computer science fundamentals, and then work with a career coach during the job search phase Go beyond the basics by building projects for your own portfolio
  • 51. © 2017 Thinkful. All Rights Reserved. 51 You’ll learn concepts, practice with drills, and build capstone projects for your own portfolio — all with 1-on-1 feedback from a mentor More about Thinkful
  • 52. © 2017 Thinkful. All Rights Reserved. 52 Outcomes Job Titles after GraduationMonths until Employed
  • 53. © 2017 Thinkful. All Rights Reserved. 53 Special promo Try the 6-month program for two weeks for $50 Learn HTML/CSS and JavaScript Continue into web development bootcamp Talk to me or Dan (or email either of us) to gain access
  • 54. Thank you! Email Dan: dan@thinkful.com Email me: dcoulter@thinkful.com April 2017