COMP 1537 - Week 1 - HTML
COMP 1537 - Week 1 - HTML
HTML Basics I
Arron Ferguson
Email:
[email protected]
Subject line [COMP1537]
Office Hours (Bby):
Zoom meetings, book an appointment
Contact information:
Both your lab instructor as well as your lecturer:
Arron Ferguson
[email protected]
Your lab instructor is your first point of contact for questions/office hours,
help – in this case, both me
Submissions of assignments/exams will be through the learning hub
Web details:
Specific protocol used is: HTTP (or HTTPS if the connection is encrypted)
Web server receives requests, sends content (HTML, CSS, JavaScript)
Web server is a computer that runs web server S/W (e.g., Apache)
Can be dedicated or shared (or a network of computers … see cloud later in slides)
Usually has plugin modules for running programming languages
For dynamic content generation (DCG)
Web browser makes requests, accepts content renders - provides
Browser is an application that renders content (e.g., text, images, video, audio)
Browsers much handle all kinds of content and types of content
E.g., JPEG, PNG, GIF – just for image types alone!
Social Media
Another norm we all expect
Changing view of computing as too technical for the masses
Corporations, organizations, governments, all recognize the need to tie in with social
media
The Internet of Things (IoT):
The connection of all kinds of devices to the Internet
Cars, refrigerators, toasters, home climate control systems/alarms, everything
Utilizing five forces: mobile platform, sensors, geo-location, big data, social media (see
the book “Age of Context”)
There are two helper languages that are used with HTML:
Cascading Style Sheets (CSS)
Used to create styling effects on elements, create rules for layouts, how to embed
fonts
E.g., make all paragraph fonts purple, ensure that a layout component only shows up if the
width of the browser window is larger than 600 pixels
JavaScript
Program code for the browser window
Allows for a wide range of functionality
Connecting to a web server, programmatically adding/editing/deleting HTML, CSS
Drawing graphics, handling user interaction, validating user input, etc.
<!--
This section is for the news feed from Twitter.
-->
What about inserting characters that are part of the HTML syntax (e.g., '<')?
Use entities
entity syntax is &name_of_entity;
Ampersand, name of entity, semi-colon
Common entities
< > " ' & ©
Can also use the Unicode values for the characters:
Ⓒ ™ Ⓡ —
HTML documents
Are simply text files
Which can be created with a text editor (e.g., Brackets, Visual Studio Code, Atom.io)
Contain exactly one root element: html
The html element contains exactly two child elements:
head, body
Whitespace in HTML is collapsed
E.g., 2 spaces, 20 tabs, 4 new lines = 1 space
If you put extra/consecutive white spaces or newlines in the code it will regard it as one white space this is
known as collapsing of white spaces.
The body element contains all of the visible elements that are rendered by
the web browser provided
Tables have:
a caption (via the 'caption' element), optional
table rows (tr element) which contain either
td – table data
th – table header
partitioning with table head (thead), table footer (tfoot), and table body (tbody) – these
are optional as well
The form element is one of the most important ways for communication to a web
server
Used for many different reasons:
Log users into a web app
Submit a transaction
Upload a photo
Edit a user profile
Play an online game
Forms can have an 'action' attribute
Which contains the URL to the resource on the server that will respond
HTML rebooted:
New form elements (e.g., date, color, email)
Persistent local storage (for multiple tabs)
Session storage (for sessions)
Websocket (sending/receiving streaming data)
Canvas – drawing stuff fast (2D/3D)
Audio/video – so plugins aren't needed
Geolocation – share physical location
Drag-n-drop – create intuitive interfaces
Custom data – add custom attributes to elements
HTML documents
Are simply text files
Which can be created with a text editor (e.g., Brackets, Visual Studio Code, Atom.io)
Contain exactly one root element: html
The html element contains exactly two child elements:
head, body
Whitespace in HTML is collapsed
E.g., 2 spaces, 20 tabs, 4 new lines = 1 space
Many editors have come and gone. Some that have gone:
Brackets, Notepad++, Dreamweaver, Atom, TextWrangler (Mac OS), Sublime –
countless others!
We’ll use: Microsoft Visual Studio Code
Google Chrome
Mozilla Firefox okay
Don't use Microsoft Internet Explorer/Edge or Apple Safari
They will slow you down
Utilize developer tools in the browser for debugging all your code
HTML, CSS, JavaScript
HTML Tutorial
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Introduction
HTML Element Reference
https://developer.mozilla.org/en-US/docs/Web/HTML/Element