week 2-intro-html

92
22-3375 Web Design I // Columbia College Chicago Introductions / HTML pt1

Upload: shawn-calvert

Post on 28-Jan-2015

116 views

Category:

Design


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Week 2-intro-html

22-3375 Web Design I // Columbia College Chicago

Introductions / HTML pt1

Page 2: Week 2-intro-html

shawncalvert.com/webdesign-1 !

TO DOdownload assignments folder,

type out answers to ex1/questions.txt

Page 3: Week 2-intro-html

Q.

Name

Major

HTML/CSS experience

What are some things you hope to accomplish this semester (outside this class)?

Page 4: Week 2-intro-html

Why you should want to succeed in this class:

“Graphic Design” is not media-speci!c

Build on your existing skills

Dif!culty of learning these skills outside of a structured environment

More jobs, better pay

It really is fun and empowering to code!

Page 5: Week 2-intro-html

How you will succeed this class:

Take it week-by-week

Be an active learner: don’t just copy and paste, ask lots of questions, make sure you understand the

underlying concepts, and be open to changing your assumptions about web design and coding

If you miss classes, be serious about contacting me (or classmates) and catching up on your work

Allow yourself time to get frustrated and start over on your assignments

Page 6: Week 2-intro-html

Internet

Page 7: Week 2-intro-html

A global network of interconnected computers.

Page 8: Week 2-intro-html

WWW

Page 9: Week 2-intro-html

!The web is just one service of the internet.

!It is system of interlinked hypertext documents accessed via the Internet. With a web browser, one can view web pages that may contain text,

images, videos, and other multimedia, and navigate between them via hyperlinks.

Page 10: Week 2-intro-html
Page 11: Week 2-intro-html

URL / DNS / IP / HTTP

Page 12: Week 2-intro-html

User types a URL (Uniform Resource Locator) into a browser, e.g., www.amazon.com

!

The URL is sent to a DNS (Domain Name Service), which translates the URL into an IP address, e.g.,

18.12.23.1 !

The correct server is found through the IP address, which is sent an HTTP request (get), and

returns the requested html pages, images, etc, back to the browser

!

Page 13: Week 2-intro-html

Server-side / Client-side

Page 14: Week 2-intro-html

Client-side coding is what we will be doing in this class, using HTML, CSS and Javascript. This

just means that our code will be downloaded from the server and then compiled entirely in

the browser.

!

!SERVERpage.html

asp

.net

java

etc

php

!!!BROWSER

style.css

script.js

Page 15: Week 2-intro-html

You do not need any special software to create html, css or javascript files, just a plain text editor. I

recommend using bbedit in class. Check out the resources page on the class site for other options.

The file extension defines the type of language of the file (file.html, file.css, file.js).

Your html/css/js files do not need to be on a server to be opened in a browser.

!

!

Page 16: Week 2-intro-html
Page 17: Week 2-intro-html

Rich Text to Plain Text

Just as with InDesign, when you receive text from someone that has already been formatted (e.g. from Word), you should always paste that text into TextEdit, and convert to plain text.

Page 18: Week 2-intro-html

Rich Text to Plain Text

In TextEdit, go to ‘Format’ to ‘Make Plain Text.’

Page 19: Week 2-intro-html

Rich Text to Plain Text

Copy and paste the plain text into your HTML and start typing in tags to recreate the document structure.

Page 20: Week 2-intro-html

Let’s get started!

Page 21: Week 2-intro-html

HTML

Page 22: Week 2-intro-html

Hyper Text +

Markup Language

Page 23: Week 2-intro-html

Hyper Text

Page 24: Week 2-intro-html

Markup Language

A markup language is a set of markup tags.

The purpose of the tags are to describe page content.

Page 25: Week 2-intro-html

Markup Language

Without any markup to give your content structure, the browser renders unformatted and unstyled text, also known as “plain text”.

Page 26: Week 2-intro-html

Markup Language

HTML tags give structure and meaning to your content. “Semantic markup” refers to the use of meaningful tags to describe content (e.g. using header tags for header content).

Page 27: Week 2-intro-html

Markup Language

Once your content is marked up, the browser applies built-in default styles to the tags. While you can override these styles with css, your marked up, non-css styled document should be readable and have a clear hierarchy.

Page 28: Week 2-intro-html

HTML Elements

Page 29: Week 2-intro-html

Anatomy of an Element

An HTML element includes both the HTML tag and everything between

the tag (the content).

<tag>Content</tag>

Page 30: Week 2-intro-html

Anatomy of an Element

The element tag gives the content structure and meaning.

<tag>Content</tag>

Page 31: Week 2-intro-html

Anatomy of an Element

Tags normally come in pairs. The first tag is the start tag, and the second

tag is the end tag.

<tag>Content</tag>

Page 32: Week 2-intro-html

Anatomy of an Element

HTML has a defined set of tag names (also called keywords) that

the browser understands.

<h1>Main Headline</h1>

Page 33: Week 2-intro-html

Anatomy of an Element

Most elements can have attributes, which provides additional informatin

about the element.

<html lang=”en”></html>

Page 34: Week 2-intro-html

Anatomy of an Element

Attributes always follow the sameformat: name=”value”. You can use

either single or double quotes.

<div class=”left-nav”></div>

Page 35: Week 2-intro-html

Tags: Basic Structure

Page 36: Week 2-intro-html

doctype

html

head

body

Page 37: Week 2-intro-html

<!DOCTYPE html>

EXCEPTION

The doctype is not actually a tag, but a declaration, telling the browser what kind of html you are using. The

doctype above declares HTML 5.

Page 38: Week 2-intro-html

<html></html> STRUCTURE

The <html> element defines the whole HTML document.

Page 39: Week 2-intro-html

<head></head>

The <head> element contains special elements that instruct the browser

where to find stylesheets, provide meta info, and more.

Page 40: Week 2-intro-html

<html lang=”en”></html>STRUCTURE

The <html> element should have a “lang” attribute to tell the browser what language

your page is written in.

Page 41: Week 2-intro-html

<body></body>

The <body> element contains the document content (what is shown

inside the browser window).

Page 42: Week 2-intro-html

Nesting

The use of our first three tags (html, head and body), introduces and important concept: Nesting, which is when tags “wrap” other tags. When you create markup, you should indicate nesting by indenting the nested tags with 2 spaces (preferred) or a tab.

Page 43: Week 2-intro-html

Document Hierarchy: Parents, children and siblings

Just as in a genealogy tree, the family hierarchy is described in terms of relationships. All elements in the document have a parent (up to ‘document’, which is at the top), and may have children (nested inside) or siblings (placed alongside).

<parent x>

<child and sibling y> </child and sibling y>

<child and sibling z> </child and sibling z>

</parent x>

Page 44: Week 2-intro-html
Page 45: Week 2-intro-html

Tags: Head Tags

Page 46: Week 2-intro-html

title base meta link

script style

Page 47: Week 2-intro-html

<title></title> STRUCTURE

The title element:• defines a title in the browser toolbar, • provides a title for the page when it is added to favorites • displays a title for the page in search engine results.

Page 48: Week 2-intro-html

<title>My Portfolio</title>EXAMPLE

Page 49: Week 2-intro-html

<meta>STRUCTURE

The <meta> tag provides metadata about the HTML document. Metadata will not be displayed on the page, but

will be machine readable.

Page 50: Week 2-intro-html

<meta charset="utf-8"> STRUCTURE

The <meta> is a single tag — it does not require a closing tag.

EXAMPLE

Page 51: Week 2-intro-html

<link>STRUCTURE

The <link> tag defines the relationship between a document

and an external resource. It is a single tag.

Page 52: Week 2-intro-html

<link rel="stylesheet" type="text/css" href="stylesheet.css">

STRUCTURE

In the example above, the <link> tag has three attributes: rel (relationship), type, and href (hypertext reference).

EXAMPLE

Page 53: Week 2-intro-html
Page 54: Week 2-intro-html

Tags: Headings

Page 55: Week 2-intro-html

<h1></h1> through

<h6></h6>

The header elements are block-leveltags that give you the ability to assign semantic weight (importance) to your

headlines.

Page 56: Week 2-intro-html

EXAMPLE

Page 57: Week 2-intro-html
Page 58: Week 2-intro-html

Tags: Images

Page 59: Week 2-intro-html

<img> STRUCTURE

The <img> element is a single, inline tag that works anywhere in the body

to insert a jpg, png, svg or gif file.

Page 60: Week 2-intro-html

The <img> tag is empty; it requires a src (source) attribute to

“pull in” the image into the page. It does not require an “alt” tag, but if the image

is essential to the content (e.g. not a background or decorative element), it

should have one.

NOTE

Page 61: Week 2-intro-html

<img src="images/logo.gif" alt=”Acme Corp”>

STRUCTURE

All <img> tags should also contain analt attribute. This is “alternate” text

that will appear if for some reason the image link is broken or the file is unavailable.

EXAMPLE

Page 62: Week 2-intro-html

Tags: Paragraphs

Page 63: Week 2-intro-html

<p></p>STRUCTURE

The <p> element is a block-level tag that contains default space-before and

space-after properties (making indention unnecessary.)

Page 64: Week 2-intro-html

EXAMPLE

Page 65: Week 2-intro-html

Tags: Lists

Page 66: Week 2-intro-html

<ul>

<ol>

<dl>

Page 67: Week 2-intro-html

List tags are always used in nested pairs. !

The wrapping tags define the list type, and indicate where the list series begins

and ends.

NOTE

Page 68: Week 2-intro-html

<ul> <li></li>

</ul>STRUCTURE

The <ul> (unordered list) element is a block-level tag that wraps a series of <li> (list item) elements. The default property

for the list items is a bullet.

Page 69: Week 2-intro-html

EXAMPLE

Page 70: Week 2-intro-html

<ol> <li></li>

</ol>STRUCTURE

The <ol> (ordered list) element is a block-level tag that wraps a series of <li> (list item) elements. The default property

for the list items is decimal (1, 2, 3).

Page 71: Week 2-intro-html

EXAMPLE

Page 72: Week 2-intro-html

Tags: Anchors (linking)

Page 73: Week 2-intro-html

<a></a> STRUCTURE

The <a> element is an inline tag that works anywhere in the

body to create a hyperlink.

Page 74: Week 2-intro-html

EXAMPLE

<a href="aboutme.html">About Me</a>

<a> tags are always used in pairs, wrapping the content you want to activate

as a link. If you use an absolute URL, it must start with “http://”.

<a href="http://www.colum.edu">My school</a>

Page 75: Week 2-intro-html

Relative vs Absolute links

Whenever you link to a file with an ‘href‘ (hypertext reference ) or ‘src’ (source) attribute, you are providing the browser and address to the resource. That address can be relative or absolute.

root directory (www.mysite.com)

index.html

images

logo.png

report.pdf

stylesheet.css

!

Page 76: Week 2-intro-html

Relative vs Absolute links

A relative link is relative to the resource’s location in its directory. It is like saying “the restaurant is 2 blocks away.” In the example below, if ‘logo.png‘ were linked from the homepage (index.html), the tag would be:

<img src=”images/logo.png”>

root directory (www.mysite.com)

index.html

images

logo.png

report.pdf

stylesheet.css

!

Page 77: Week 2-intro-html

Relative vs Absolute links

An absolute link is the full address to the resource’s location in the entire web. It is like saying “the restaurant is at 222 West Grand, Chicago IL 60625.”

<img src=”http://www.mysite.com/images/logo.png”>

root directory (www.mysite.com)

index.html

images

logo.png

report.pdf

stylesheet.css

!

Page 78: Week 2-intro-html
Page 79: Week 2-intro-html

Where did those text styles come from?

All browsers have what is called a “client stylesheet” that applies formatting

to your html elements, such as text size, font, color, margins, line-height, and much more.

Your custom css overrides some of these default styles.

Page 80: Week 2-intro-html

But it is ugly!

Before we begin learning how to add visual design to our pages, it is crucial

that we understand how to create a foundation of solid structural design.

Page 81: Week 2-intro-html

FTP

Page 82: Week 2-intro-html

File Transfer Protocol

Local(your computer) Host

(www)

Page 83: Week 2-intro-html

FTP Software

All premium code editors have ftp built in, which allows you to sync your project files to the server easily.

You will often need to post or download files from the server manually. For this you can use dedicated ftp software:

Fetch, Transmit and FileZilla & Fireftp (both free) are all good choices for Mac.

Page 84: Week 2-intro-html
Page 85: Week 2-intro-html
Page 86: Week 2-intro-html

WALKTHROUGH: Set up a project in bbedit

Page 87: Week 2-intro-html

Wordpress

Page 88: Week 2-intro-html

CMS

A Content Management System (CMS) is a computer program that allows publishing, editing and modifying content on a web site as well as maintenance from a central page.

Page 89: Week 2-intro-html

index.php database

Dynamic CMS

Page 90: Week 2-intro-html
Page 91: Week 2-intro-html

WALKTHROUGH: Set up a theme in Wordpress

Page 92: Week 2-intro-html

WALKTHROUGH: Create a post in Wordpress