introduction to web programming
DESCRIPTION
A short introduction to web technologies and building web sitesTRANSCRIPT
![Page 1: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/1.jpg)
Web Programming IntroYnon Perek
Saturday, December 15, 12
![Page 2: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/2.jpg)
Whoami
Ynon Perek
http://ynonperek.com
Saturday, December 15, 12
![Page 3: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/3.jpg)
Agenda
The Web Architecture
Hello HTML
Hello CSS
Hello JavaScript
Saturday, December 15, 12
![Page 4: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/4.jpg)
The Web Architecture
Here It Is
GET data
Client Side Server Side
Saturday, December 15, 12
![Page 5: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/5.jpg)
Server Side
Server side creates the data and returns it to the client
All server-side languages return the same result: HTML
There are many languages...
Saturday, December 15, 12
![Page 6: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/6.jpg)
Client Side
Client side takes the data and renders it on screen
Provides a UX around the data
Can send data back to the server
Browsers: IE, Chrome, Firefox, Safari
Saturday, December 15, 12
![Page 7: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/7.jpg)
The Data
Data is in a format called HTML (Hyper Text Markup Language)
Invented by Tim Berners-Lee
Saturday, December 15, 12
![Page 8: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/8.jpg)
The Data
A browser renders HTML document on screen
HTML is a tag-based language
<html><body> <h1>Hello World</h1> <p>All your base are belong to us</p></body></html>
Saturday, December 15, 12
![Page 9: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/9.jpg)
The Data
Tag-based means you need to use the same opening and closing tag
<div>How Do You Annoy A Web Developer ?</span>
Saturday, December 15, 12
![Page 10: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/10.jpg)
Available Tags
Tags (or markup) define the role of their content
Headers:h1, h2, h3, h4, h5, h6
Block Sections: div
Inline Sections: span
Saturday, December 15, 12
![Page 11: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/11.jpg)
DemoInline vs. Block One Two Three (inline)
Container (Block)
Saturday, December 15, 12
![Page 12: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/12.jpg)
Adding Links
Use <a> tag to create a link
<a> is an inline element
Example:
<a href=”http://google.com”>Go To Google</a>
Saturday, December 15, 12
![Page 13: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/13.jpg)
Adding Images
Use <img> tag to create an image
<img> is an inline-block element: It flows it text, but has height and width like a block
alt attribute tells google what’s in the photo
Example:<img src=”http://fc02.deviantart.net/fs21/f/2007/306/d/6/Chibi_turtle_by_blackcattlc.jpg” alt=”Cool Turtle”>
Saturday, December 15, 12
![Page 14: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/14.jpg)
Adding Text
Use <p> tag to wrap text paragraphs
<p> is a block-level element
Adds a newline
Saturday, December 15, 12
![Page 15: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/15.jpg)
Clickable Images
Wrap in <img> in an <a> tag to get an image that is also a link
Demo: images, links and text paragraphs
Saturday, December 15, 12
![Page 16: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/16.jpg)
Lists
HTML has two types of lists: ordered lists marked <ol> and unordered lists marked <ul>
Inside a list block, use <li> to denote items
<ul>, <ol> and <li> are all block elements
Saturday, December 15, 12
![Page 17: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/17.jpg)
Lab
Create an HTML document for your resume
Use correct headers
Add an image
Saturday, December 15, 12
![Page 18: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/18.jpg)
Pages With StyleIntroducing CSS
Saturday, December 15, 12
![Page 19: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/19.jpg)
Cascading Style Sheets
Apply styling rules to elements
Choose an element with a selector
Specify rules using properties
Saturday, December 15, 12
![Page 20: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/20.jpg)
Let’s Start With The Basics
Select all h1 elements
Write text in red
h1 { color: red; }
Saturday, December 15, 12
![Page 21: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/21.jpg)
Let’s Start With The Basics
More CSS styling properties:
background-color, color
font-weight, font-size, font-family, font-style, text-decoration
text-align, line-height
outline
Saturday, December 15, 12
![Page 22: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/22.jpg)
Let’s Start With The Basics
Use #id to find a specific HTML element
h2#main { color: red;}
And in HTML:<h2 id=‘main’>Red</h2>
Saturday, December 15, 12
![Page 23: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/23.jpg)
Let’s Start With The Basics
Use .class to find a set of HTML elements
h2.uppercase { text-transform: uppercase;}
And in HTML:<h2 class=‘uppercase’>Red</h2>
Saturday, December 15, 12
![Page 24: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/24.jpg)
Block Level Properties
Only block (or inline-block) elements have size
width and height are only applicable to block elements
Saturday, December 15, 12
![Page 25: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/25.jpg)
Lab
Using the docs:https://developer.mozilla.org/en-US/docs/CSS
Style this HTML:http://pastebin.com/Wm2s8EnH
Saturday, December 15, 12
![Page 26: Introduction to Web Programming](https://reader033.vdocuments.us/reader033/viewer/2022042614/554dae22b4c905fa7a8b4f9f/html5/thumbnails/26.jpg)
Thank You
Photos From:
http://www.flickr.com/photos/pedrosimoes7/5158386021/
http://123rf.com
Saturday, December 15, 12