html & css 2017

117

Upload: colin-loretz

Post on 16-Apr-2017

48 views

Category:

Software


4 download

TRANSCRIPT

Page 1: HTML & CSS 2017
Page 2: HTML & CSS 2017

https://about.me/colin.loretz

Page 3: HTML & CSS 2017
Page 4: HTML & CSS 2017

INTRODUCTIOn

TO HTML

Page 5: HTML & CSS 2017

TOOLS OF

THE TRADE

Page 6: HTML & CSS 2017

TEXT EDITOR

Download at http://atom.io

Page 7: HTML & CSS 2017

http://atom.io

Page 8: HTML & CSS 2017

Chrome

Firefox

Safari

Edge & IE

BROWSERS

Page 9: HTML & CSS 2017

HANDLING HTML

PROJECT FILES

Page 10: HTML & CSS 2017

BUILDING THE

FOUNDATION

Page 11: HTML & CSS 2017

HTML BUILDING BLOCKS

Page 12: HTML & CSS 2017

<!DOCTYPE html>HTML5 DOCTYPE

Page 13: HTML & CSS 2017

<html>html tag

Page 14: HTML & CSS 2017

<!DOCTYPE html><html>The rest our our websitewill go here.</html>

Page 15: HTML & CSS 2017

<head>head definitions

Page 16: HTML & CSS 2017

<!DOCTYPE html><html><head></head></html>

Page 17: HTML & CSS 2017

<title>page title

Page 18: HTML & CSS 2017

<!DOCTYPE html><html><head><title>Our First Page</title>

</head></html>

Page 19: HTML & CSS 2017

<body>document body

Page 20: HTML & CSS 2017

<!DOCTYPE html><html><head><title>Our First Page</title>

</head><body>The rest of our website here

</body></html>

Page 21: HTML & CSS 2017

<!-- # -->comments

Page 22: HTML & CSS 2017

<!DOCTYPE html><html><head><title>Our First Page</title>

</head><body><!-- This is a comment -->The rest of our website here

</body></html>

Page 23: HTML & CSS 2017

<h1>heading tags

Page 24: HTML & CSS 2017

<h2>heading tags

Page 25: HTML & CSS 2017

<h3>heading tags

Page 26: HTML & CSS 2017

<h4>heading tags

Page 27: HTML & CSS 2017

<h5>heading tags

Page 28: HTML & CSS 2017

…<h1>Largest Heading</h1><h2>Largest Heading</h2><h3>Largest Heading</h3><h4>Largest Heading</h4><h5>Largest Heading</h5>…

Page 29: HTML & CSS 2017

<p>paragraph tag

Page 30: HTML & CSS 2017

…<h1>Our headline</h1><p>Some cool paragraph text.</p><p>Another awesome paragraph with even more text.</p>…

Page 31: HTML & CSS 2017

<br>line break

Page 32: HTML & CSS 2017

…<h1>Our headline</h1><p>An awesome paragraph with a line <br /> break in it.</p>…

Page 33: HTML & CSS 2017

<small>smaller font size

Page 34: HTML & CSS 2017

…<h1>Our headline</h1><p>This word will be <small>smaller</small> than the rest.</p>…

Page 35: HTML & CSS 2017

element attributes

Page 36: HTML & CSS 2017

<a>anchor (link) tag

Page 37: HTML & CSS 2017

<a href=“http://google.com”>

anchor (link) tag

Page 38: HTML & CSS 2017

…<h1>Our headline</h1><p>This word will be <a href=“https://google.com”>a link</a> to google.com.</p>…

Page 39: HTML & CSS 2017

<img>image tag

Page 40: HTML & CSS 2017

<img src=“loading.gif”>

image tag

Page 41: HTML & CSS 2017

…<h1>Our headline</h1><p>A time machine!</p><img src=“delorean.gif”>…

Page 42: HTML & CSS 2017

BUILD TIME

Create a new HTML document that includes:

• Doctype • Head • Title • Body • H1 Headline • H3 Headline • Paragraphs • Bold text • Link to your favorite website • An image

Page 43: HTML & CSS 2017

<ul>unordered list

Page 44: HTML & CSS 2017

<li>list item

Page 45: HTML & CSS 2017

…<ul><li>Apples</li><li>Bananas</li><li>Oranges</li>

</ul>…

Page 46: HTML & CSS 2017

INTERMEDIATE

HTML

Page 47: HTML & CSS 2017

<div>div containers

Page 48: HTML & CSS 2017

…<div>Any HTML content you want to organize in a div container, including more divs.</div>…

Page 49: HTML & CSS 2017

<span>span containers

Page 50: HTML & CSS 2017

…<div>Any <span>HTML</span> content you want to organize in a div container, including more divs.</div>…

Page 51: HTML & CSS 2017

NAMING THINGS

Page 52: HTML & CSS 2017

ids

Page 53: HTML & CSS 2017

…<div id=“intro”>Some text

</div>…

applied to a singular element

Page 54: HTML & CSS 2017

classes

Page 55: HTML & CSS 2017

…<div class=“product”>Product 1

</div><div class=“product”>Product 2

</div>…

applied to many elements

Page 56: HTML & CSS 2017

semantic web

Page 57: HTML & CSS 2017

self documenting

Page 58: HTML & CSS 2017

INTRODUCTION

TO CSS

Page 59: HTML & CSS 2017

adding style!

Page 60: HTML & CSS 2017

inline css

Page 61: HTML & CSS 2017

…<div style=“color: red”>Any HTML content you want to organize in a div container, including more divs.</div>…

Page 62: HTML & CSS 2017

<style>style tag

Page 63: HTML & CSS 2017

…<style>div {color: red;

}</style>…

Page 64: HTML & CSS 2017

using .css files

Page 65: HTML & CSS 2017

…<head><link rel="stylesheet" href=“css/mystyle.css” media="screen" charset="utf-8"></head>…

Page 66: HTML & CSS 2017

html {font-family: arial;

}

body {margin: 0px;padding: 0px;

}

mystyle.css

Page 67: HTML & CSS 2017

selectors

Page 68: HTML & CSS 2017

element selectors

h2 { … }

li { … }

p { … }

div { … }

body { … }

table { … }

Page 69: HTML & CSS 2017

.product { … }

li.product { … }

li .product { … }

class selectors

Page 70: HTML & CSS 2017

#intro { … }

div#intro { … }

div #intro { … }

id selectors

Page 71: HTML & CSS 2017

#intro ul.products li {/* styles go here */

}

mix and match selectors

Page 72: HTML & CSS 2017

css properties

Page 73: HTML & CSS 2017

providing structure

Page 74: HTML & CSS 2017

height:50px;

Page 75: HTML & CSS 2017

width:100px;

Page 76: HTML & CSS 2017

margin:5px 5px 5px 5px;

Page 77: HTML & CSS 2017

display:inline;

Page 78: HTML & CSS 2017

display:block;

Page 79: HTML & CSS 2017

display:none;

Page 80: HTML & CSS 2017

typography

Page 81: HTML & CSS 2017

font-family:helvetica, arial, sans-serif;

Page 82: HTML & CSS 2017

font-size:12px;

Page 83: HTML & CSS 2017

font-size:12pt;

Page 84: HTML & CSS 2017

font-size:1em;

Page 85: HTML & CSS 2017

font-size:70%;

Page 86: HTML & CSS 2017

font-weight:bold;

Page 87: HTML & CSS 2017

font-weight:normal;

Page 88: HTML & CSS 2017

text-decoration:underline;

Page 89: HTML & CSS 2017

text-decoration:none;

Page 90: HTML & CSS 2017

color!

Page 91: HTML & CSS 2017

color:black;

Page 92: HTML & CSS 2017

color:#000000;

Page 93: HTML & CSS 2017

color:#000;

Page 94: HTML & CSS 2017

color:rgb(0,0,0);

Page 95: HTML & CSS 2017

background-color:

black;

Page 96: HTML & CSS 2017

div {height: 50px;width: 100px;color: white;font-size: 16px;background-color: black;

}

putting it all together

Page 97: HTML & CSS 2017

introducing thebox model

Page 98: HTML & CSS 2017

height

width

Page 99: HTML & CSS 2017

margin-top

margin-bottom

margin-rightmar

gin-

left

Page 100: HTML & CSS 2017

padding:5px 5px 5px 5px;

Page 101: HTML & CSS 2017

div {height: 50px;width: 100px;padding: 5px 10px 5px 10px;margin: 5px 10px 5px 10px;

}

putting it together

Page 102: HTML & CSS 2017

5px

50px100px

5px

5px

5px

10px 10px10px 10px

Page 103: HTML & CSS 2017

height of elementpadding-toppadding-bottommargin-topmargin-bottomborder-topborder-bottom+actual height

Page 104: HTML & CSS 2017

width of elementpadding-leftpadding-rightmargin-leftmargin-rightborder-rightborder-left+actual width

Page 105: HTML & CSS 2017

div {margin: top right bottom left;

}

putting it together

div {margin: 5px 10px 5px 10px;

}

Page 106: HTML & CSS 2017

div {margin: 5px 10px;

}

shorthand

div {margin: 5px;

}

Page 107: HTML & CSS 2017

floats

Page 108: HTML & CSS 2017

div {float: left;

}

img {float: right

}

Page 109: HTML & CSS 2017

CSS TIPS & TRICKS

Page 110: HTML & CSS 2017

STYLING A CSS BUTTON

http://codepen.io/rcacademy/pen/JXMPRa

Page 111: HTML & CSS 2017

BACKGROUND IMAGES

div {

background-image: url(path/to/image.jpg);background-size: cover;background-repeat: no-repeat;

}

Page 112: HTML & CSS 2017

Floats!

http://codepen.io/rcacademy/pen/MyrEWJ

Page 113: HTML & CSS 2017

UL LIst as a NAV

http://codepen.io/rcacademy/pen/GZyMBJ

Page 114: HTML & CSS 2017

BUILD TIME

CSS Layout Exercise

https://github.com/rcacademy/webdevcamp/tree/master/week1/w1d3

Page 115: HTML & CSS 2017

CSS RESET

• Resets allow you to set things to make your website look consistent across browsers

• You can add more than one stylesheet to a page

• Alternatively, you can do a normalize.css that sets all of your elements to a common baseline that is not 0.

Page 116: HTML & CSS 2017

USER BADGES

http://codepen.io/rcacademy/pen/yOpLWd

Page 117: HTML & CSS 2017

BUILD TIME

https://about.me/colin.loretz