intro to html

55
Intro to HTML

Upload: amazing-rando

Post on 08-Sep-2014

15 views

Category:

Technology


1 download

DESCRIPTION

These are the slides from my Intro to HTML talk that I gave for Trade School Indy on 12 Feb, 2014. More information posted at http://randyoest.com/html/ or follow me on Twitter at @amazingrando.

TRANSCRIPT

Page 1: Intro to HTML

Intro to HTML

Page 2: Intro to HTML

Randy Oest Manager of Digital Design Williams Randall Marketing

!

@amazingrando

Page 3: Intro to HTML

Why Learn HTML?

1. Running a blog on a CMS and want to tweak things

2. Working with a developer and want to understand how to talk with them

3. Web designer looking to understand how things get built

Page 4: Intro to HTML

What We’ll Learn

1. What is HTML

2. How to mark up a document

3. How a page is structured

Page 5: Intro to HTML

HTML is the Skeleton of Web pages.

Page 6: Intro to HTML
Page 7: Intro to HTML

HTML is aMarkup Language

Page 8: Intro to HTML

Marky MarkupLanguage

Page 9: Intro to HTML
Page 10: Intro to HTML

HTML uses markup tags to describe elements on a page. <tag>Text</tag>

Page 11: Intro to HTML

Anatomy of a Tag

<tag>Text</tag>

Start Tag End Tag

Page 12: Intro to HTML

About 80 Tagsa  

abbr  

acronym  

address  

area  

b  

base  

bdo  

big  

blockquote  

body  

br  

button  

caption  

cite  

code  

col  

colgroup  

dd  

del  

dfn  

div  

dl  

DOCTYPE  

dt  

em  

fieldset  

form  

h1,  h2,  h3,  h4,  h5,  and  

h6  

head  

html  

hr  

i  

img  

input  

ins  

kbd  

label  

legend  

li  

link  

map  

meta  

noscript  

object  

ol  

optgroup  

option  

p  

param  

pre  

q  

samp  

script  

select  

small  

span  

strong  

style  

sub  

sup  

table  

tbody  

td  

textarea  

tfoot  

th  

thead  

title  

tr  

tt  

ul  

var

Page 13: Intro to HTML

Some Are Used More Oftena  

abbr  

acronym  

address  

area  

b  

base  

bdo  

big  

blockquote  

body  

br  

button  

caption  

cite  

code  

col  

colgroup  

dd  

del  

dfn  

div  

dl  

DOCTYPE  

dt  

em  

fieldset  

form  

h1,  h2,  h3,  h4,  h5,  and  

h6  

head  

html  

hr  

i  

img  

input  

ins  

kbd  

label  

legend  

li  

link  

map  

meta  

noscript  

object  

ol  

optgroup  

option  

p  

param  

pre  

q  

samp  

script  

select  

small  

span  

strong  

style  

sub  

sup  

table  

tbody  

td  

textarea  

tfoot  

th  

thead  

title  

tr  

tt  

ul  

var

Page 14: Intro to HTML

Nesting Tags

<i><b>italic & bold</b></i>

Page 15: Intro to HTML

Self-closing Tags

Some tags don’t wrap around anything. These are self-closing tags. <img  src=“”>  or <img  src=“”  />

Page 16: Intro to HTML

Tags Can Have Attributes

Attributes are additional information added to a tag.

<img  src=“”>  

<a  href=“”  class=“”>  

<div  class=“”>

Page 17: Intro to HTML

Tags are used to give semantic meaning to text. e.g., paragraph, header, bold, emphasis, etc.

Page 18: Intro to HTML

Let’s Learn By Example

Page 19: Intro to HTML
Page 20: Intro to HTML

Starting the HTML

<!DOCTYPE  html>  <html>       <body>         <!—-­‐  content  —-­‐>           </body>  </html>  

Page 21: Intro to HTML

Let’s talk about Headings, Paragraphs, and Formatting.

Page 22: Intro to HTML

Headings

Headings are defined with the <h1> to <h6> tags.

<h1> defines the most important heading. <h6> defines the least important heading.

Page 23: Intro to HTML

DO NOT use headings to make text BIGGER or BOLDER. Styling should be done with CSS.

Page 24: Intro to HTML

You have signed up for Intro to CSS, right?

Page 25: Intro to HTML

Paragraphs

Paragraphs are defined with the <p> tag.

<p>This is some stuff </p>

Page 26: Intro to HTML
Page 27: Intro to HTML
Page 28: Intro to HTML

Links

Links are defined with the <a> tag with the href pointing to the destination.

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

Page 29: Intro to HTML

Two Varieties of Links Absolute & Relative.

Page 30: Intro to HTML

Absolute Links

Absolute links point directly to the destination.

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

Typically starts with http://

Page 31: Intro to HTML

Relative Links

Relative links are based on where the destination is from where you are.

<a  href=“/folder/page.html”>Text</a>  <a  href=“../page.html”>Text</a>

Page 32: Intro to HTML
Page 33: Intro to HTML
Page 34: Intro to HTML

Images

Images are self-closing tags

<img  src=“mocha.jpg”  />  

<img  src=“mocha.jpg”  alt=“Mocha  the  cat”  />  

Page 35: Intro to HTML
Page 36: Intro to HTML
Page 37: Intro to HTML

Lists

Lists come in two varieties, ordered and unordered.

1. Item

2. Item

3. Item

•Item

•Item

•Item

Page 38: Intro to HTML

List Items

List items use the <li> tag.

<li>Loves food</li>  <li>Good at cuddling</li>  <li>Chews wires</li>

Page 39: Intro to HTML

Lists Need An Outer Tag

Ordered lists use the <ol> tag.

<ol>     <li>Loves food</li>     <li>Good at cuddling</li>     <li>Chews wires</li>  </ol>

Page 40: Intro to HTML

Lists Need An Outer Tag

Unordered lists use the <ul> tag.

<ul>     <li>Loves food</li>     <li>Good at cuddling</li>     <li>Chews wires</li>  </ul>

Page 41: Intro to HTML
Page 42: Intro to HTML
Page 43: Intro to HTML

Now let’s roll up our sleeves and talk about layout.

Page 44: Intro to HTML

Layout

Most pages have a header, content and footer.

Page 45: Intro to HTML

<div>

Page 46: Intro to HTML

The Magic of <div>

The <div> tag can be used with IDs and Classes to become whatever they need to be.

Page 47: Intro to HTML

IDs and Classes

IDs and Classes provide targets for CSS and Javascript.

Page 48: Intro to HTML

IDs and Classes

IDs are unique.

Classes are reusable.

Page 49: Intro to HTML

Examples

<div  id=“header”></div>  <div  id=“nav”></div>  <div  class=“active-­‐region”></div>

Page 50: Intro to HTML
Page 51: Intro to HTML

Comments

The comment tag is useful for making notes in HTML.

<!—-­‐  comment  here  —-­‐>

Page 52: Intro to HTML
Page 53: Intro to HTML
Page 54: Intro to HTML

<div>’s Have No Style

By themselves <div>’s have no style or formatting.

CSS is used to style the presentation of HTML.

Page 55: Intro to HTML

Further Learning

RandyOest.com/HTML

W3Schools (free)

Team Treehouse (not free)