While you're settling in, discuss with someone near you...
about.html
file that you would like
to know more about?
Administrivia
Discuss Accessible Design
Finish discussing HTML
Yes really!
but you should not feel like you will know everything yet
and we do learn more as we delve deeper into CSS and JS
Start CSS
Answer yes if...
Answer no if...
WPL starts today after class (SIG 228)
Sections
Atom with Git (and cloning!)
Due: Saturday, April 6, 11:00 pm
GitGrade Lock: April 7, 11:00 pm
Due: Thursday, April 11, 11:00 pm
GitGrade Lock: Sunday April 14, 11:00 pm
Also a reminder to sign up for Mentor Circles by Friday! (but the sooner the better)
Things that are relevant
From Wikipedia
Content
Words and images
Structure
HTML
Style
CSS
Behavior
Javascript & Server programs
Describes the content and structure of information on a web page
Surrounds text content with opening and closing tags
Each tag's name is called an element
<element> content </element>
<p>This is a paragraph</p>
Most whitespace is insignificant in HTML (ignored or collapsed to a single space)
We will use a newer version called HTML5
<!DOCTYPE html>
<html>
<head>
information about the page
</head>
<body>
page contents
</body>
</html>
HTML
The <head>
tag describes the page and the <body>
tag contains the page's content
An HTML page is saved into a file ending with extension .html
The DOCTYPE
tag tells the browser to interpret our page's code as HTML5, the lastest/greatest version of the language
There are many different types of HTML tags used to structure web pages (we can't possibly cover all of them within lecture).
A comprehensive list is here (it's a great bookmark page for reference this quarter!)
Unless otherwise specified, all of the tags listed are required to be in the <body>
of an HTML page rather than the <head>
Our compiled list is here and here
<!
like is <!DOCTYPE html>
is considered
Markup
Declaration
<hr>
can either have the slash in the tag or not, but BE CONSISTENT IN YOUR
CODE.
<hr />
<hr>
Two (equivalent) examples of the self-closing horizontal rule tag (HTML)
Q: The img tag is another self-closing tag. What characteristics do these two tags have that make them appropriate as "self-closing" compared to content-holding tags like the paragraph tag?
<!DOCTYPE html>
<html>
<head>
<title>About Me: Nicole Riley</title>
</head>
<body>
<header>
<h1>About Me: Nicole Riley</h1>
</header>
<main>
<article>
<p>Hello, everyone! My name is ......</p>
</article>
</main>
...
</body>
</html>
Some tags can contain additional information called attributes
<element
attribute="value"
attribute="value">
content </element>
<a href="page2.html">Next page</a>
Where else did you see attributes yesterday?
<html lang="en">
<meta charset="UTF-8">
<img src="" alt="insert descriptive text for screenreaders" />
<img src="" alt="insert descriptive text for screenreaders" />
Everyone has different abilities
Nearly 1 in 5 people have a disability in the U.S. (from the U.S. Census)
from W3C Web Accessiblity Initiative (WAI)
Disabilties can be temporary
Disabilties can be situational
Disability affects all of us
Designs that account for all abilities are called accessible designs
Enable your phone's screen reader
Input works differently now. For example, tap now reads the screen and double-tap selects. Use two or three fingers to scroll by page. Play with it for a minute.
Try closing your eyes and reading a webpage or a social networking site. Try writing an email.
Medical view
Legal view
Sociocultural view
Design for as many users as possible, not just the average user
Example: Airplane cockpits:
Universal Design is often used in architecture
Instead of focusing on the abilities that someone lacks (dis-ability), and trying to compensate
Focus on making systems work with what abilities people have
Don't make people adapt to the system
Make the system adapt to the abilities of the user
First two are required, other five are recommended
From the A11y Project
Tools
Resources
What did you learn from the readings?
article
vs section
We get this question a LOT
Others ask this too
Here are two resources to help you:
Basically: Article should be standalone content. Section is not.
And remember: div
div has no semantic meaning,
should only be added for selecting content in CSS/JS, and should be your "last resort"
<article>
,
<strong>
<b>
<html lang="en">
Note: These design principles help in other ways as well
<img src="img/koalafications.jpg" alt="Koalified koala" />
HTML
output
The src
attribute specifies the image URL
HTML5 also requires an alt
attribute describing the image, which
improves the web page
experience for all (if the image doesn't load)
<a href="http://en.wikipedia.org/wiki/Koala/">
<img src="images/irrelephant.jpg" alt="Irrelephant elephant"
title="dumbo!" />
</a>
HTML
What's the title attribute?
title
attribute is an optional tooltip (on ANY element)
title
attribute doesn't always work well for mobile and accessibility, so its usage and future are debated
White space usually doesn't matter in HTML pages, except apparently here
Preview of imagelinktext.html
Content
Words and images
Structure
HTML
Style
CSS
Behavior
Javascript & Server programs
<p>
<font face="Arial">Welcome to Greasy Joe's.</font>
You will <b>never</b>, <i>ever</i>, <u>EVER</u> beat
<font size="+4" color="red">OUR</font> prices!
</p>
HTML
Welcome to Greasy Joe's. You will never, ever, EVER beat OUR prices!
output
Tags such as b, i, u
and font
are discouraged in strict HTML
Why is this bad?
<head>
...
<link href="filename" rel="stylesheet" />
...
</head>
HTML (template)
<link href="style.css" rel="stylesheet" />
HTML (example)
CSS describes the appearance and layout of information on a web page (as opposed to HTML, which describes the content)
Can be embedded in HTML or placed into separate .css
file (preferred)
selector {
property: value;
property: value;
...
property: value;
}
CSS (template)
p {
color: red;
font-family: sans-serif;
}
CSS (example)
A CSS file consists of one or more rules
A rule selector specifies HTML element(s) and applies style properties
*
selects all elements