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 you want to build?
About you — programming experience?
• I’ll write my first lines of code tonight
• I’ve been coding for under three months
• I’ve been coding for three months or longer
Goals
• Core concepts of HTML/CSS to build websites
• Drills to practice those concepts
• Build your first website
• Get more comfortable learning to code
• Take home challenges
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
Clients / Servers
Client (sends requests)
Frontend Developer
Manages what user sees
Server (sends response)
Backend Developer
Manage what app does
Example: facebook.com
HTML, CSS, &
Javascript render
interactive newsfeed
Algorithm determines
what’s in your feed
Request
Get data about your
friends’s and their posts
Open browser
and navigate to
facebook.com
Application Logic
Database
Response
Client Server
How it relates to what we’re doing
When we write HTML & CSS today, we are creating
those files that are stored on a server which are then
sent and then rendered by your browser
Setup
http://bit.ly/tf-html-classroom
Normally to write our code we’d use a text editor or an
integrated development environment (IDE)
But since we’re learning we’re going to write our code
in a website to skip the setup, see our results
immediately, and make it easy for us to track progress
Let’s start with HTML
HTML is the content and structure of a webpage
It’s the skeleton of your website
HTML tags
Every tag starts with a “less than” sign and ends with a
“greater than” sign
<html> #this is an HTML opening tag
<body> #this is a body opening tag
<h1>Hello world!</h1> #this is set of
H1 tags
</body> #this is a body closing tag
</html> #this is an HTML closing tag
More about tags
• There are opening tags and closing tags — closing tags
have a backslash before the tag name (</html> versus
<html>)
• Tags instruct a browser about the structure of our
website
• There are hundreds of built-in tags though you’ll use
the same few a lot
Non-exhaustive list of HTML tags
• <html> #html tags wrap your entire page
• <head> #head tags holds info about the page
• <body> #body tags wrap around your content
• <h1> #signifies the largest headline (through h6)
• <p> #wraps a paragraph of writing
• <div> #div tags are generic container tags
• <a> #anchor tags for text to be a link
• <ul><li> #unordered list of items
• <button> #this is a button
HTML elements
HTML elements usually consist of an opening tag,
closing tag, and some content
<html> #html element starts here
<body> #body element starts here
<h1>Hello world!</h1> #this is an
HTML element
</body> #body element ends here
</html> #html element ends here
More about elements
Some consist of just a self-closing tag
<img src=“http://i.imgur.com/Th5404r.jpg">
A note about <div>’s
We use <div> tags to separate sections of our site. This
will allow for sophisticated styling. It’s a good habit to
“wrap” most sections into a <div>
<div>
<h1>Hello world!</h1>
</div>
HTML attributes
HTML attributes set properties on an element — the are
attached in the opening tag
<a href=“https://somewhere.com">This is a
link</a>
href is an attribute that sets the destination of a link
<h1 class=“headline”>This is a headline</h1>
class is one attribute that identifies element (for CSS &
Javascript)
CSS selectors
• Determine HTML elements to target for styles
• Can target tags, classes, id’s and many more!
• Selectors can be combined
Example selectors
p (selects all paragraph tags)
.name (selects HTML elements with class “name”)
p.name (selects paragraph tags with class “name”)
CSS properties
Determines aspect of an element’s appearance to change
• color (set the font color)
• font-family (sets main and backup typefaces)
• background-image (sets background image)
• height (sets the height of an element)
More on CSS properties
• Each property has a default value — when you write
CSS, you override that default with a new value
• There are lots of CSS properties! For a full list see
http://www.htmldog.com/references/css/properties/
CSS values
Determines the aspect of the element’s appearance we
wish to change
• color: red, blue, green, #CCCCCC
acceptable values for the color property
• font-family: helvetica, arial, sans-serif
acceptable values for the font-family property
• background-image: url(“imageFile.jpg")
looks for a URL value for image file
• height: 40px, 50%
set in pixels or percentage of container height
Declarations and declaration blocks
This is a declaration block containing two declarations
p {
color: red;
font-size: 36px;
}
Linking CSS to HTML
• 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">
Learning to learn
• Google is your friend!
• Practice at the edge of your abilities
• Ignore the hot new thing. Instead go deep with one
technology
Ways to keep learningLevelofsupport
Learning methods
Try us out!
• Initial 2-week trial
includes six mentor
sessions for $50
• Learn HTML/CSS and
JavaScript
• Option to continue
onto web
development
bootcamp
• Talk to me (or email
jasjit@thinkful.com) if
you’re interested