BIM222 InternetProgramming Week4
BIM222 InternetProgramming Week4
Outline
§ Components and Structure of a Website
§ What Comprises a Website
§ Structure of a Website
§ What kinds of files
§ HTML
§ What is HTML
§ History and Philosophy of HTML
§ Internet Browsers
§ Editors
§ HTML Tag Syntax
§ DOM & Basic HTML Structure
§ Common HTML Tags
1
3/23/21
Structure of a Website
2
3/23/21
§ HTML + CSS
week4-sampleCodes/Structure_Style_Behavior_Difference/example1/style.html
§ HTML + CSS + JS
week4-sampleCodes/Structure_Style_Behavior_Difference/example1/behavior.html
3
3/23/21
§ HTML + CSS
week4-sampleCodes/Structure_Style_Behavior_Difference/example2/style.html
§ HTML + CSS + JS
week4-sampleCodes/Structure_Style_Behavior_Difference/example2/behavior.html
Outline
§ Components and Structure of a Website
§ What Comprises a Website
§ Structure of a Website
§ What kinds of files
§ HTML
§ What is HTML
§ History and Philosophy of HTML
§ Internet Browsers
§ Editors
§ HTML Tag Syntax
§ DOM & Basic HTML Structure
§ Common HTML Tags
4
3/23/21
What is HTML?
5
3/23/21
6
3/23/21
Outline
§ Components and Structure of a Website
§ What Comprises a Website
§ Structure of a Website
§ What kinds of files
§ HTML
§ What is HTML
§ History and Philosophy of HTML
§ Internet Browsers
§ Editors
§ HTML Tag Syntax
§ DOM & Basic HTML Structure
§ Common HTML Tags
7
3/23/21
§ In HTML the tags indicate where headings, images, lists, links, line
breaks, and other components should go
.html Files
§ When your computer opens a .html file, it knows to open it in an
Internet browser (Chrome, Firefox, Safari, etc.)
§ The browser can read this file and know how to display it on the
screen
§ Screen readers and other assistive devices can also utilize the HTML
tags to present the information in special ways
8
3/23/21
HTML Files
HTML History
§ HTML was present in the document sharing system that Berners-Lee
developed at CERN in the early 1990’s
§ The HTML Working Group, created by the IETF, released HTML 2.0 as
a standard in 1995
§ Additional versions of this standard have since been created under
the W3C (www.w3.org)
§ HTML5, released in 2011, incorporates new features such as video
playback and drag-drop capabilities
9
3/23/21
Declarative Programming
§ Markup languages are examples of declarative programming
languages:
§ Programming flow control is not specified
§ Programs specify what not how
§ In the case of markup languages such as HTML, this means that you
specify what should appear on a webpage, but not how it should look
(i.e., how it’s styled) or behave (e.g., when it’s visible, animations)
Semantic HTML
§ There is a design principle related to publishing entitled separation of
content and presentation – the meaning (i.e., semantics) of a
document should be separated from how this meaning is presented
to readers
§ Advantages associated with using this design principle:
§ The same content can be rendered differently, depending upon the needs of
the user (e.g., as text, as braille, etc.)
§ You can change in one place how a recurrent item in the document is style
§ By capturing the meaning of a document, further intelligent machine
processing of the document is supported
10
3/23/21
Outline
§ Components and Structure of a Website
§ What Comprises a Website
§ Structure of a Website
§ What kinds of files
§ HTML
§ What is HTML
§ History and Philosophy of HTML
§ Internet Browsers
§ Editors
§ HTML Tag Syntax
§ DOM & Basic HTML Structure
§ Common HTML Tags
Internet Browsers
§ The purpose of browsers is to read HTML documents and display
them
§ Browsers do not display the HTML tags, but use them to render the
content of the page (or determine how to display the document)
§ Different browsers have their pros and cons
§ Most people have a preferred browser
§ You need to test your site on multiple browsers
§ Browsers can vary in how well they adhere to HTML5 standards
§ Different versions of browsers need to be considered as well
11
3/23/21
Internet Explorer
§ One of the most popular browsers
§ Preinstalled on Microsoft Windows and free to download
§ Not available on the Mac
Safari
§ Works on Mac and Windows operating systems
§ Free to download
§ Default browser on iPhones and iPads
Google Chrome
§ Freeware browser developed by Google
§ Fast browsing
§ Greater security
Firefox
§ Free browser developed by Mozilla
§ Works on Windows and Mac
§ Secure and fast
§ Resource heavy
12
3/23/21
Outline
§ Components and Structure of a Website
§ What Comprises a Website
§ Structure of a Website
§ What kinds of files
§ HTML
§ What is HTML
§ History and Philosophy of HTML
§ Internet Browsers
§ Editors
§ HTML Tag Syntax
§ DOM & Basic HTML Structure
§ Common HTML Tags
3. Decide on an editor
§ Windows (Notepad, Notepad++, Sublime*)
§ Mac (TextEdit, TextWrangler, Sublime*)
13
3/23/21
Outline
§ Components and Structure of a Website
§ What Comprises a Website
§ Structure of a Website
§ What kinds of files
§ HTML
§ What is HTML
§ History and Philosophy of HTML
§ Internet Browsers
§ Editors
§ HTML Tag Syntax
§ DOM & Basic HTML Structure
§ Common HTML Tags
14
3/23/21
15
3/23/21
16
3/23/21
17
3/23/21
Outline
§ Components and Structure of a Website
§ What Comprises a Website
§ Structure of a Website
§ What kinds of files
§ HTML
§ What is HTML
§ History and Philosophy of HTML
§ Internet Browsers
§ Editors
§ HTML Tag Syntax
§ DOM & Basic HTML Structure
§ Common HTML Tags
18
3/23/21
Root element
<html>
Element Element
<head> z <body>
§ Head
§ Metadata The HTML document itself
begins with <html> and ends
§ Body with </html>
§ Displayable content
19
3/23/21
Doctype
§ All HTML documents must start with a document type declaration
§ Represents the document type, and helps browsers to display web pages
correctly
§ It must only appear once, at the top of the page (before any HTML tags)
§ Not case sensitive
§ HTML5
§ <!DOCTYPE html>
Head
§ Additional information used by the browser
§ Meta data (data about data) – language, title, character set
§ Supporting files – JavaScript, CSS - Styling, Add-ons
20
3/23/21
Body
§ Bulk of your page
week4-sampleCodes/template.html
Example
21
3/23/21
Common Tags
§ HTML Headings
§ <h1>, <h2>, <h3>, <h4>, <h5>, <h6>
§ <h1> defines the most important heading
§ <h6> defines the least important heading
§ These tags have syntax and semantics
§ Search engines use the headings to index
the structure and content of your web
pages
§ Users skim your pages by its headings
§ It is important to use headings to show
the document structure, not for to make
text big or bold
week4-sampleCodes/links-to-samples/heading.html
22
3/23/21
Common Tags
§ Paragraphs
§ <p>…</p>
§ Line Breaks
§ <br> element defines a line break
§ The <br> tag is an empty tag - has no end tag
§ Horizontal Ruler
§ <hr> tag defines a thematic break in an HTML page, and is most often
displayed as a horizontal rule
§ Used to separate content or define a change in an HTML page
§ Comments
§ <!-- … -> week4-sampleCodes/links-to-samples/paragraph.html
23
3/23/21
Common Tags
§ Links
§ HTML links are hyperlinks
§ You can click on a link and jump to another document
§ When you move the mouse over a link, the mouse arrow will turn
into a little hand
§ In HTML, links are defined with the <a> tag
Common Tags
§ Lists week4-sampleCodes/links-to-samples/links.html
§ Unordered List week4-sampleCodes/links-to-samples/unordered-lists.html
§ Ordered List week4-sampleCodes/links-to-samples/ordered-lists.html
§ HTML Description List week4-sampleCodes/links-to-samples/description-lists.html
https://www.w3schools.com/html/html_entities.asp
§ Special Entries
§ Images week4-sampleCodes/links-to-samples/images.html
week4-sampleCodes/links-to-samples/table.html
§ Tables week4-sampleCodes/links-to-samples/table-with-image.html
24
3/23/21
Additional Resources
§ Getting to Know HTML
§ http://learn.shayhowe.com/html-css/getting-to-know-html/
§ W3Schools
§ https://www.w3schools.com/html/default.asp
25
3/23/21
Summary
§ HTML
§ Annotates content
§ Defines document structure
26