Gather Workshops Logo

Building the Web

Create and publish your own web page

Say hi to your mentors!

Your mentors are here to help if you get stuck,
and you can ask them (almost) anything!

Introductions

What is your:

Favourite thing?

Super power?

First name?

Schedule


How the Internet Works
HTML and CSS Basics

Morning Break

Layouts and Menu Bars
Embedding Videos

Lunch Break

Photo Gallery
Publishing

Gather Workshops Logo

Mission One

Figure out how the Internet works

What is the Internet?

If a 5-year-old asked you "What is the Internet?"
how would you answer?

Internet Brainstorm

What do we use the Internet for?

How do we access the Internet?

Who pays for the Internet, and who gets paid?

The Internet
vs
The World Wide Web


What's the difference?

The Internet

A global system of interconnected computer networks.

The Internet is a network
of computer networks.

World Wide Web

A system of interlinked documents, accessed via the Internet.

The Web is a network
of documents and media.

Who owns it all?

Who owns the Internet?
And who owns the Web?

Who owns the Internet?

  • Nobody
  • Lots of people


Who owns the World Wide Web?

  • Content Creators
  • You!

A web page is made of three main languages

Venn diagram of HTML, CSS and JS all overlapping

HTML is the markup language

Screenshot of Google with only HTML enabled

CSS is the style sheet language

Screenshot of Google with both HTML and CSS enabled

JavaScript is the programming language

Screenshot of Google with all of HTML, CSS, JS enabled

HTML + CSS + JS = Website!

Loading a Webpage

Diagram of how a web page is served

Kinda like telephones!

The Internet can be compared to the telephone system:

  • Nobody owns the whole thing
  • Companies do control individual parts
  • Telephone numbers and IP addresses are unique
  • There is no central control room

An ISP can charge extra to allow access

to your favourite website


e.g. Facebook, YouTube, Google

A government can censor access to information

e.g. North Korea and China

Chorus owns the Southern Cross Cable

They could slow down international requests for other ISPs

Your corner of the web

By creating your own website, you are taking ownership of a small portion of the world wide web.

It's all yours.

You can publish and share anything you like, go forth and create!

Gather Workshops Logo

Dive into HTML

Putting content on your page

HTML With Alpacas

Open this link in a new tab: Alpacas Code

Keep it open! We are going to be using HTML
to make it look way better.

CodePen Editor

CodePen shows us our code on the left,
and the output on the right:

Screenshot of CodePen UI

Alpaca Text Example

We will use code to make our output look like this

Headings

Add <h1> and </h1> tags to make the Alpacas heading big and bold.

<h1>Alpacas</h1>

<h1> says "start the heading here"

</h1> says "end the heading here"

Subheadings

Now use <h2> tags to make Alpaca Hair and Habitat big.

<h2>Alpaca Hair</h2>

h1 is the biggest heading
h2 is the second biggest heading
h3 is the third biggest heading

h6 is the smallest heading

Paragraphs

Now use <p> tags to split up your paragraphs.

<p>
An alpaca is a domesticated species of 
South American camelid. It resembles a 
small llama in appearance.
</p>

Put a <p> before each paragraph,
and a </p> after each paragraph.

Image Tags

Add an img tag to the very bottom of your code:

<img src="#" height="100">

src stands for "source"
Replace the # with a link to an image online.

height is the height of the image
This is optional, it is the height in pixels.

Image Source

Find an image online, and copy the link to it.

Replace the # as the src value, using paste:

<img src="http://place.com/photo.jpg" height="100">

Find and add at least 2 more images.

Final Result

Your own output window should now look like this:

See the Pen gbyXgo by Gather Workshops (@gatherworkshops) on CodePen.

Gather Workshops Logo

Designing with CSS

Styling your page content

CSS With Grumpy Cat

Open this link in a new tab: Grumpy Cat Code

Keep it open! We are going to be using CSS
to make it look way better.

CodePen Editor

CodePen can show us both our HTML and our CSS:

Screenshot of CodePen UI

Grumpy Cat Example

Next we will use code to make our output look something like this:

Grumpy Cat Example

Classes

To make our page look pretty, first we create a CSS class with a unique name.

In your CSS panel:

.profile-pic {
  width: 200px;
}

We just created a class called profile-pic.

This class can change the width of something on our page to be 200px.

Applying Classes

Find the first image tag in the HTML panel,
and apply the profile-pic class to it.

Find this line your HTML panel:

<img src="http://gathergather.co.nz/grumpy-cat.png">

And change it to:

<img class="profile-pic" src="http://gathergather.co.nz/grumpy-cat.png">

Cartoon Grumpy Cat should now be much smaller.

Font Styles

There are many font options in CSS. We can create another class to try them out.

In your CSS panel, on a new line:

.page-title {
  font-family: "Comic Sans MS";
  font-size: 50px;
  text-align: center;
  text-shadow: 5px 5px 5px rgba(0,0,0,0.5);
}

In your HTML, find the h1 and apply the class:

<h1 class="page-title">Grumpy Cat</h1>

Block Elements

Block elements are the "building blocks" of our website.

Block elements are used for layout, and can contain other elements.

Header HTML

Our header block will contain the profile pic, "Grumpy Cat" heading and the first paragraph of text.

In your HTML, on the line before the profile pic:

<header class="page-header">

In your HTML, after the first paragraph:

</header>

There should now be a dark blue box at the top of your page.

Header Styles

Let's design a header to contain Grumpy Cat's profile pic, page title, and first paragraph.

In your CSS, on a new line:

.page-header {
  background-color: darkblue;
  color: white;
  font-size: 22px;
  font-weight: bold;
  text-align: center;
}

Our header block will have large, centered, bold text.

Info Section HTML

This content block is a section not a header, so we use the section tag.

In your HTML, before the second paragraph:

<section class="info-section">

And after the third paragraph:

</section>

There should now be a yellow block around two paragraphs.

Info Section Styles

Now we want a box around the other two paragraphs.

In your CSS, on a new line:

.info-section {
  background-color: yellow;
  padding: 20px;
  margin-top: 30px;
  margin-bottom: 30px;
}

Element Selectors

Rather than always using classes, we can also choose to style all HTML elements of the same type.

At the top of your CSS, on a new line:

header,
section {
  width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 130%;
}

All your sections (and your header) should now be centered on the page.

Whole Page Styles

When we have styles we want to apply to the whole page, we can target the body, because all other tags are between the body tags.

At the top of your CSS, on a new line:

body {
  background-color: gold;
  background-image: url(http://subtlepatterns.com/patterns/food.png);
  font-family: sans-serif;
}

Your background should now be yellow with a pattern.

Element Selectors

Now all that we have to do is tidy up our colours. We need to remove the backgrounds we used for planning our layout.

In your CSS:

  • Find .page-header and remove the background
  • Find .info-section and change background to white
  • Find .gallery-section and remove the background

Grumpy Cat Output

Your own output window should now look like this:

See the Pen yyrQMr by Gather Workshops (@gatherworkshops) on CodePen.

If it doesn't, check that all your styles are correct!

Challenge

Design your own "Breaking News" item:

  • Go to nzherald.co.nz
  • Right click on the main story heading and 'Inspect Element'
  • Edit the headline to make your own news!

Try these too:

  • Modify the paragraph text to match your headline
  • Change the image source to link to a different image
  • Take a screenshot!

HTML vs CSS

What are the differences?

Gather Workshops Logo

Layout Builder

Design a theme for your site

Page Layout Design

Image of website with header, nav and content area

This is what our page layout will look like

Using a Layout

Index page will be used as a template for images page and videos page

We can copy our layout to make more pages

CloudCannon lets you edit and preview your website

Cloud Cannon lets us edit our code and preview our site

Create a New Project

In CloudCannon, click "Create Site" and make a project

Site Template

We will create images, index and style in our project folder

Template Files


images

All your images go in this folder.

index.html

HTML code for your home page.

style.css

CSS code for your whole website.

Create Index Page

Create index.html in your dashboard

Index Page Starter Code

<!DOCTYPE html>
<html>

    <!-- head only used by the browser -->
    <head>
        <title>My Page Title</title>
        <link rel="stylesheet" href="style.css">
    </head>

    <!-- body contains the visible page content -->
    <body>
        <!-- My HTML Code Goes Here-->
    </body>

</html>

Copy this HTML code into your index.html

HTML Head

<head>
    <title>My Page Title</title>
    <link rel="stylesheet" href="style.css">
</head>

The head contains a browser tab title and a CSS file link

HTML Body

<body>
    <!-- My HTML Code Goes Here-->
</body>

All of our page content HTML goes between the body tags

Create Stylesheet

Create style.css in your dashboard

Choose a Background Type

Tiled

A smaller image which repeats
to fill the whole page.

Full-Screen

A large image which stretches
to fill the whole page.

Right-click an image and "Save Image As..."

Upload Background Image

Upload the background image to CloudCannon

Move Background to Images Folder

Use the image options to "Move to new folder"

Tiled Background

If you want a repeating background, use this code.

Add to your style.css:

html {
    background-image: url('images/ravens-tile.gif');
}

Make sure to choose an image which tiles nicely!

Full-Screen Background

If you'd like a full-screen background, use this code.

Add to your style.css:

html {
    background-image: url('images/tree-cover.jpg');
    background-size: cover;
    background-attachment: fixed;
}

Make sure to choose a nice large image!

Background Ideas

Take a few minutes to make your background
look how you want it.

Header

The header goes at the top of the page. It will be a plain box containing a heading.

Adding a header to your page

Header Content

Add to index.html, between the body tags:

<header class="page-header">
    <h1>My Awesome Website</h1>
</header>

You should now see a heading on your page.
The header box will be invisible until you add CSS.

Header Design

Add to your style.css:

.page-header {
    background-color: #222222;
    color: #FFFFFF;
    padding: 20px;
}

This code will give your header a dark grey background,
white text and 20px of spacing around the inside edge.

Header Ideas

Take a few minutes to make your header
look how you want it.

Page Content Area

The content area goes under the header. It will be a plain box containing some basic text content.

Adding the main content to your page

Content Section

Add to your index.html, on a new line after your closing </header> tag:

<section class="page-content">

    <h2>Hello there, amazing person!</h2>

    <p>
    This is a site all about my favourite stuff, 
    thanks so much for visiting.
    </p>

</section>

We will use this page-content section on every page,
but we will change the content inside it for each page.

Content Section Design

Add to your style.css:

.page-content {
    background-color: #222222;
    padding: 30px;
    width: 700px;
    margin: 0 auto;
    margin-top: 30px;

    color: #FFFFFF;
    font-size: 14px;
    line-height: 130%;
}

This code will give you a starting point to begin
designing your content section.

Summary

Using HTML and CSS, you've now made
a whole web page!

Next we will add some more pages to our site.

Gather Workshops Logo

Embedding YouTube Videos

Video chaos!

Videos

YouTube Embed Code

Find a YouTube video you like

Click "Share", then click "Embed"

Copy the code, and use it in your site!

TODO

Loading...