announcements - university of maryland€¦ · 1. class webpage: –have you been reading the...

16
Announcements 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted 2. Campus is closed on Monday. 3. Install Komodo Edit on your computer this weekend. 4. Bring laptops on Wednesday! © 2017 Fawzi Emad, Computer Science Department, UMCP 1

Upload: others

Post on 20-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

Announcements1. Class webpage:

– Have you been reading the announcements?

– Lecture slides and coding examples will be posted

2. Campus is closed on Monday.

3. Install Komodo Edit on your computer this weekend.

4. Bring laptops on Wednesday!

© 2017 Fawzi Emad, Computer Science Department, UMCP

1

Page 2: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

Recall: How Browser gets Web Page

1. You type “http://www.cs.umd.edu/~fpe/example.html” into your browser

2. Your browser sends request to DNS server to look up the IP Address for www.cs.umd.edu.

3. The DNS server’s response contains the IP address

4. Browser sends HTTP “GET” request to web server located at this IP Address

5. Web server’s response contains HTTP header and the HTML file you requested

6. Browser interprets the HTML file and renders the page

© 2017 Fawzi Emad, Computer Science Department, UMCP

2

Page 3: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

Uniform Resource Locator (URL)

http://www.cs.umd.edu/~fpe/example.html

© 2017 Fawzi Emad, Computer Science Department, UMCP

3

Domain NameProtocol File name (including path)

Page 4: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

Uniform Resource Locator (URL)Options for protocol:

– http

– https

– ftp

– File

– Many others…

Other possibilities:

– Using IP address instead of domain name:

http://163.122.8.150/webpage.html

– Specifying port number:

http://www.blah.com:80/webpage.html

– Query String:

http://www.blah.com/webpage.html?name=Fred&age=25

– Fragment Identifier:

http://www.blah.com/webpage.html#section2

© 2017 Fawzi Emad, Computer Science Department, UMCP

4

Page 5: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

HTML, CSS, JavaScript

HTML is used to define the structure of the page

CSS (Cascading Style Sheets) used to define the style of the page

Javascript will be used to make webpage interactive

Great online tutorials:– http://www.htmldog.com/

– http://www.w3schools.com/

– These links are on class webpage under “Resources”

© 2017 Fawzi Emad, Computer Science Department, UMCP

5

Page 6: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

HyperText Markup Language (HTML)

• Simple language used to define web pages

• Web browser “interprets” the HTML and “renders” the web page

• Standards maintained by W3C (World Wide Web Consortium)– Led by Tim Berners-Lee

– http://www.w3.org/Consortium/

© 2017 Fawzi Emad, Computer Science Department, UMCP

6

Page 7: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

Evolution of HTML

• History of HTML: http://www.html5code.com/tutorials/a-brief-history-of-html/

• Most up-to-date version: HTML 5

– Not fully supported by all browsers

– We will use this for class

– We will not be using any “advanced” features

© 2017 Fawzi Emad, Computer Science Department, UMCP

7

Page 8: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

Creating HTML Files

• HTML code is just “text”

– Could use ANY text editor

– We prefer tool like “Komodo Edit”

• Knows HTML and detects many mistakes

• Automatically fills in certain details

• Formats code nicely (auto-indentation, nice colors, etc.)

• Many advanced features

• Install it on your machine right away!

– In this class, you may NOT use a web authoring tool that automatically generates HTML for you!

© 2017 Fawzi Emad, Computer Science Department, UMCP

8

Page 9: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

HTML Tags and Elements

• Tags specify how portions of your document will be structured

• Most tags must be used in pairs (opening and closing tags)

• An element is a section that is demarked by a corresponding pair of tags

<b>This text is in bold.</b>

© 2017 Fawzi Emad, Computer Science Department, UMCP

9

Opening TAGStart of “bold”

Closing TAGEnd of “bold”

Element

Page 10: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

Solitary Tags

Some tags are solitary:

<hr /> Horizontal Rule

<br /> Line break

© 2017 Fawzi Emad, Computer Science Department, UMCP

10

Page 11: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

HTML 5 Skeleton

• All HTML 5 web pages must have these features• Let’s talk about what we see here (next slide…)

<!DOCTYPE html>

<html>

<head>

<title>Page Title</title>

</head>

<body>

My Web Page.

</body>

</html>

© 2017 Fawzi Emad, Computer Science Department, UMCP

11

Page 12: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

HTML 5.0 Skeleton<!DOCTYPE html>

– Tells the browser what language we will use

© 2017 Fawzi Emad, Computer Science Department, UMCP

12

Info about document

What gets displayed

HTML<html>

</html>

<head><title> My Web Page</title>

</head>

<body>

</body>

Page 13: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

HTML “White Space”

Komodo Edit Demonstration… Use HTML 5 template

What happens when we enter the following as the “body” of a web page?

one two three

four five

six

seven

© 2017 Fawzi Emad, Computer Science Department, UMCP

13

Page 14: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

Examples of Tags

All examples from class will be on the class webpage.

• Paragraphs.html

• Headings.html

• OtherTags.html

– Notice how tags are “nested”:<i><b>blah, blah, blah</b></i> Correct!

<i><b>blah, blah, blah</i></b> Incorrect!

• Where can we find a list of all available tags?

© 2017 Fawzi Emad, Computer Science Department, UMCP

14

Page 15: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

HTML Validation

• HTML 5 standard is very strict

• Code must be “validated”: http://validator.w3.org

(Link is also on Resources section of class webpage)

• Why is validation important?

Let’s try validating some of our examples…

© 2017 Fawzi Emad, Computer Science Department, UMCP

15

Page 16: Announcements - University Of Maryland€¦ · 1. Class webpage: –Have you been reading the announcements? –Lecture slides and coding examples will be posted 2. Campus is closed

Annoying Detail

The HTML 5 skeleton generated by Komodo Edit is incomplete!

Don’t forget to put this in the “head” section:

<meta charset="UTF-8" />

© 2017 Fawzi Emad, Computer Science Department, UMCP

16