Welcome to Advanced GIS, Lecture 5

This is a web page that can be viewed as slides.

→ to move forward

← to go back

Advanced GIS

Class 5

Andrew
Andrew
Tara

HTML

HyperText Markup Language

HTML

HyperText Markup Language

(text with links)

vox
Stanford

Tim Berners-Lee

The original RFC (standard) for HTML

independent.co.uk
twitter

Mosaic, initially released in 1993

Mosaic

HTML defines the content of web pages

HTML tells the browser what to put on the page

HTML isn't going to help you make things look nice

HTML isn't going to help you make things look nice

(we'll talk about CSS soon)

every HTML page starts out the same way:

<!doctype html>
<html>
    <head>
    </head>
    <body>
    </body>
</html>
<!doctype html>
<html>
    <head>
    </head>
    <body>
        Content to show on the
        page goes here!
    </body>
</html>
<!doctype html>
<!doctype html>

tells the browser, "get ready, I'm about to start speaking HTML"

<html>
<html>

tells the browser, "okay, this is the beginning of the HTML"

<head>
</head>

things we'll get to later (styles and scripts) go between these

<body>
</body>

page content goes between these

</html>

tells the browser, "this is the end of the HTML"

<!doctype html>
<html>
    <head>
    </head>
    <body>
    </body>
</html>
<body>
<body>

the body opening tag

<body>

the body opening tag

opening tags always start with

<
<body>

the body opening tag

opening tags always start with

<

and end with

>
</body>

the body closing tag

</body>

the body closing tag

closing tags always start with

</

and end with

>
<!doctype html>
<html>
    <head>
    </head>
    <body>
    </body>
</html>

let's make an html file

in-class exercise, part 1

<iframe width="100%" height="520" frameborder="0"
src="https://thenewschool.carto.com/u/brelsfoeagain/
builder/fd0fea4a-ee46-11e6-8c31-0ecd1babdde5/embed"
allowfullscreen webkitallowfullscreen mozallowfullscreen
oallowfullscreen msallowfullscreen></iframe>
        

iframe

iframe

lets you embed other pages in your page

let's add a Carto map to our html file

<!doctype html>
<html>
    <head>
    </head>
    <body>
        <p>
            Text goes here
        </p>
    </body>
</html>
<!doctype html>
<html>
    <head>
    </head>
    <body>
        <p>
            Text<br />
            goes here
        </p>
    </body>
</html>
<p>
    Text goes <em>here</em>
</p>
<p>
    Text goes <strong>here</strong>
</p>
<a>
    This should be a link
</a>
<a href="http://example.com/awesome/page">
    This should be a link
</a>
<img src="" />

in-class exercise, part 2

Looking at other people's pages

view source

developer tools

<ul>
    <li>eggs</li>
    <li>milk</li>
    <li>bread</li>
</ul>
<ul>
    <li>eggs</li>
    <li>milk</li>
    <li>bread</li>
</ul>
<ol>
    <li>one</li>
    <li>two</li>
    <li>three</li>
</ol>
<ol>
    <li>one</li>
    <li>two</li>
    <li>three</li>
</ol>
  1. one
  2. two
  3. three
<div>
</div>
<div id="header">
</div>
<div id="header">
    logo
    etc
</div>
<span></span>
<input />
<input type="text" />
<input type="checkbox" />
yes
no
maybe
<input type="radio" />
yes
no
maybe
html
head
body
p
br
a
img
em
strong
ul
ol
li
div
span
input

HTML reference on class page

HTML in Carto

in-class exercise, part 3

some notes on terminology

elements

element:

an opening tag, closing tag, and all the things inside it

<!doctype html>
<html>
    <head>
    </head>
    <body>
        <p>
            Text goes here
        </p>
    </body>
</html>

"a p element"

<!doctype html>
<html>
    <head>
    </head>
    <body>
        <p>
            Text goes here
        </p>
    </body>
</html>

"a body element"

elements go inside other elements

<!doctype html>
<html>
    <head>
    </head>
    <body>
        <p>
            Text goes here
        </p>
    </body>
</html>

"the p element is in the body element"

<!doctype html>
<html>
    <head>
    </head>
    <body>
        <p>
            Text goes here
        </p>
    </body>
</html>

"the p element is also in the html element"

indent elements one more step than the elements they are inside

<!doctype html>
<html>
    <head>
    </head>
    <body>
        <p>
            Text goes here
        </p>
    </body>
</html>

everything in the html element is indented once

<!doctype html>
<html>
    <head>
    </head>
    <body>
        <p>
            Text goes here
        </p>
    </body>
</html>

everything in the body element is indented again

make sure you move an entire element

move this

<!doctype html>
<html>
    <head>
    </head>
    <body>
        <p>
            Text goes here
        </p>
    </body>
</html>

don't move this

<!doctype html>
<html>
    <head>
    </head>
    <body>
        <p>
            Text goes here
        </p>
    </body>
</html>

when sharing code with me it's helpful to put it online

codepen.io
jsbin.com

neither of these is suitable for publishing a page, just for sharing snippets

this is going to take some effort

don't memorize this stuff

copy paste is recommended

copy paste (with your customizations) is recommended

learn more here

codecademy.com/tracks/web

and here

learn.shayhowe.com/html-css

avoid!

recommended

developer.mozilla.org

recommended

css-tricks.com