Select all the text and paste into blank text editor document. Template 1 contains most used HTML5 elements. Template 2 does not. Text is at 25% so it can be easily copied. Make sure you copy all of the text.
Template 1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<!-- Sets viewport to the device screen size -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!--Link an external style sheet-->
<link href="css/styles.css" rel="stylesheet">
<style>
main { max-width: 1500px; }
section { max-width: 1000px; margin: 10px auto; padding: 0 20px; }
img {width: 100%}
figure {width: 25%; margin: auto;}
/* Overrides desktop style when viewport is less than 600px (for smart phones) */
@media only screen and (max-width: 600px) {
}
</style>
</head>
<!-- body -->
<body>
<main>
<section>
<header>
<h1>Heading 1</h1>
<nav>
<ul>
<li>
<a href="#">
navigation as unordered list item
</a>
</ul>
</nav>
</header>
<article>
<h2>Heading 2</h2>
<p>The <strong>template</strong> contains <em>most used</em> HTML5 elements. Replace this text with the content written for the first assignment. Notice that there is no closing tag for this paragraph or for the list item in the navigation above.
<figure>
<img src="http://b.parsons.edu/~dejongo/12-fall/stuff/01-blocks.gif" alt="blocks" >
<figcaption>Blocks. The figure tag make adding a caption below the picture possible. The picture tag makes multiple pictures possible, and places the img, an inline element, in a block element. </figcaption>
</figure>
</article>
<footer>
<hr>
<p>Resources
<ul>
<li> HTML <a href="http://b.parsons.edu/~dejongo/01-writing-html5/#inline_elements" >inline</a> and <a href="http://b.parsons.edu/~dejongo/01-writing-html5/#block_elements" >block</a> elements.
<li> Writing <a href="http://b.parsons.edu/~dejongo/03-the-mechanics-of-css/" >CSS</a>, <a href="http://b.parsons.edu/~dejongo/03-applying-css/" >examples</a>, <a href="http://b.parsons.edu/~dejongo/04-the-layout-modes/" >layout</a> and <a href="http://b.parsons.edu/~dejongo/05-styling-the-navigation/" > styling the navigation</a>
<li><a href="https://validator.w3.org" >Validate your page</a>
<li><a href="https://web.dev/measure/" >Page quality audit</a>
</ul>
</footer>
</section>
</main>
</body>
</html>
Template 2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<!-- Sets viewport to the device screen size -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!--Link an external style sheet-->
<link href="css/styles.css" rel="stylesheet">
<style>
/* Overrides desktop style when viewport is less than 600px (for smart phones) */
@media only screen and (max-width: 600px) {
}
</style>
</head>
HTML stands for Hyper Text Markup Language. If you wish to see the entire specification in a one page version (large document), visit the living standard
Content is “marked up” using tags to designate the structural significance of that content. Each piece of content so marked up constitute an HTML element, of which there are many.
A first level header is designated by opening and closing tags: <h1> 01 Writing HTML5 </h1>. All parts of the document are marked up with such tags to create HTML elements, even parts that you cannot see but still describe the document, such as the meta tags found in the header, or the <style> and <script> tags that contain CSS and Javascript.
To create an HTML page, open a text processor. Creating a new file and call it index.html when saving. The file needs to be called index.html with a lower “i”. It is the index of the directory in which it is located. It will be the file that is opened upon entering that directory.
Every directory should have an index.html file, as some web servers allow visitors to see the content of the directory when there is no index.html file present. Other files in the directory can be reached by placing links connecting that page on the index.html page.
The following elements make up the HTML page:
The Structure of an HTML Document
The Doctype
The doctype has been greatly simplified in HTML5. The DOCTYPE tells the browser the version of the HTML rules the document will follow. Using the following DOCTYPE tells the browser you will be using HTML5. This is the only DOCTYPE I expect to see.
<!DOCTYPE html>
The HTML Element
The HTML elements contains all other elements. It is the root element, and the language attribute is specified as English.
<html lang="en">
The Head Element
The head element contains information about the content but not the content itself. This is known as the document;s metadata. The head element does not get displayed in the browser window.
The Character encoding declaration specifies the encoding used to store or transmit the document. The Meta tag charset=”utf-8” tells the browser to use the unicode universal character set transformation format—8-bit.
The title shows up as the title of the browser window.
The header element closes before the body element opens.
The Body Element
Markup written in the body element shows up in the viewport, or browser window. Think of this element as encompassing everything that appears in the browser window.
Everything you write comes between the opening and closing body tag. In the following, only “Hello World!” will show. Comments are not rendered by the browser.
<body>
<!-- Comment your Work! -->
<p>Hello World!</p>
</body>
The body element closes before the html element closes.
The Closing HTML element
Closing the HTML element is the last tag on the page. It closes the tag that holds all of the other elements in the document.
</html>
Element or a Tags?
An element is a single “chunk” of code comprising of a start and ending tag. They are representations of a thing for the browser, an object. Elements have all kinds of properties for the browser, like firstChild, etc.
<div>This is a div element</div>
Tags is the opening and closing code of the elements. <div> is a tag. <div>content</div> is an element.
“Elements are not tags. Some people refer to elements as tags (e.g., “the P tag”). Remember that the element is one thing, and the tag (be it start or end tag) is another. For instance, the HEAD element is always present, even though both start and end HEAD tags may be missing in the markup.” From W3 HTML specification
The Inherent Structure of HTML
HTML is concerned with the structure of the content, and not with how the content should be displayed.
The natural flow of content is inline, meaning that content flows horizontally, like the letters on a line of text. In English, that is from left to right but it could be in any direction.
In addition to the horizontal inline flow of content, elements can be determined to be block like and flow vertically. Block elements do not flow like characters but like paragraphs, as entire blocks of text. By default, their width expands to fill the parent element and the flow is vertical. They flow down the page, starting from the upper left hand corner.
In HTML, block elements cannot descend from (be a child of) inline elements. Inline elements are the content of a block element.
CSS can change the display property of an element. It can make inline elements display as block elements, and block elements display as inline elements. That is very useful, usually to make inline elements act like block elements.
Valid HTML requires that block level elements do not descend from inline elements. Changing the elements displays with CSS does not change the validity requirements of the HTML document.
Tag Attributes and Values
Tag Attributes
HTML tags can take attributes, which describe certain aspects of the elements, with different elements having various assigned attributes. There needs to be a space between each attribute. Attributes for the img tag, for example, are src, width, height, class, and alt.
Example: <img src="file_name" alt="logo">
Example: <a href="file_name">File Name</a>
Values
Every attribute has a value, even if it is an empty value. For example, the value of the src (source of the image) is the location and name of the image. While it is no longer a requirement to put either double or single quotes, as long as there are no spaces or other non-alphanumeric characters, it still best practice to do so.
Example: <img src="file_name" alt="logo">
Example: <a href="file_name">File Name</a>
Role Attributes
The role attribute describes the role(s) the current element plays in the context of the document. In the official language of the W3 “The XHTML Role Attribute allows the author to annotate XML Languages with machine-extractable semantic information about the purpose of an element. Use cases include accessibility, device adaptation, server-side processing, and complex data description.” Example: <nav roll="navigation">
Understanding the Tag Hierarchy
DOCKTYPE
html
head
meta
title
style
body
main
header
nav
ul
li
li
li
li
section
article
h2
p
p
img
figure
img
figcaption
p
footer
HTML is a collection of elements arranged in a kind of containment hierarchy. This is a parent – child relationship, where the enclosing tag is the parent of the enclosed tag, which is its child. The entire structure can be likened to a tree, with the <html> tag as the single trunk from which the rest of the branches arise, first splitting into the two main branches, the <head> and the <body>. inside the body tag are all of the other branches that make up the document.
After the <doctype>, the HTML document starts with the <html> element that contains all other elements. It contains only two tags, the <head> and the <body> tags.
The <head> tag contains information about the page (meta-information) but that is not visible, like the <title> tag, <meta>tags and <html>, <style> and <script> tags and links <link>to styles and scripts.
The <body> tag contains all of the content, everything that’s visible in the browser window. The tags are usually several levels deep. Nesting tags is very useful, for it groups elements together. This makes it easy to create the different parts of the layout.
In the figure on the right, the <wrapper> contains all of the other visible content. This element is usually given automatic margins that center it horizontally in its parent tag, the <body>. If the <wrapper> is moved to the right, all the child elements contained within it are moved to the right as well.
Because each element is a child of another element, there are only clearly determined paths. For example, the <img> is a child of <p>, which is a child of <article>, which is a child of <section>, which is a child of <wrapper>. The complete path of the <img> tag is html body wrapper section article p img. This path would select all images in the paragraphs contained in article, section, wrapper, body, html. Since there are no other images, only the image with the red background is targeted by this path. The <img> in the figure has a different path, for example.
How to Write the Code
A tab is used to show how many levels the code is nested from the <html> element. This results in a visual way to check if the code is nesting properly. The code should look like :
To make it easy on you, there are tools that let you clean up your hierarchies automatically. You’ll want to remember this link right before you hand in your midterm and at the end of the semester, when you hand in your final.
The HTML file with all of its codes and content gets parsed by the browser. The syntax of each tag will be analyzed to see how it fits together according to the HTML rules. This results in a document object model where each node represents a branch on the tree.
General Rules To Follow
HTML5 has loosened up the rules somewhat but it is still desirable to follow these rules for well formed HTML documents.
Close Every Tag
Most Tags contain content, meaning that there is an open tag and a closing tag to signify where the content starts and where it ends. Some tags do not need to close, like <img>because there is no content. These tags are pointer to content, and get replaced by that content. Other tags are self closing, like the <meta /> and <br /> tags. List of self-closing tags: area, base, br, col, embed, hr, img, input, keygen, link, meta, param, source, track, and wbr.
Accidentally not closing a tag can cause all kinds of havoc and will be flagged when validating. It is a common occurrence in the first few weeks of writing code.
Correctly Nest Every Tag
If a tag opens before a preceding one closes, it must be closed before that preceding one closes. <header><h1>Title</h1></header> not <header><h1>Title</header></h1> CSS relies on proper nesting to target styles to elements, so you have to get this right. In this example, the </h1> tag is nested in the </header> tag, and is the child of the header, which is the parent tag. As a container, a tag acts like a group, and moving a parent also moves all of the enclosed children. Likewise, absolute positioning is based on the coordinates of the parent element.
If you visualize each element as a node on a tree, it is obvious that you cannot open a tag before the previous tag is closed. If you make a mistake, the browsers can sometimes repair the damage, and everything still displays correctly but don’t count on it, and different browsers have different levels of damage control.
Inline Tags Cannot Contain Block Level Tags.
Block-level elements follow one another according to the document flow, one below the other. Inline elements follow one another as characters in a paragraph. While it would seem obvious to not mix these two up, the validator will catch you if you do.
Keep Tags Lower Case
This is a requirement of XHTML5, which we will not concern ourselves with but its a good idea anyway.
Tags Used to “Mark Up” the Content
Learning HTML comes through writing HTML. The more you code, the easier it becomes till it’s second nature. The content is divided into inline and block tags.
Block elements display like paragraphs, coming one after the other vertically down the page in the document flow.
Inline elements display just like characters, coming one after the other horizontally till the end of the line. The line then breaks and resumes at the beginning the next line down, and so on.
CSS allows you to override the object’s default display and make inline elements display like block elements or vice versa. You’ll learn about that later.
There are many HTML elements. Mozilla organizes them according to function. That’s helpful. Don’t memorize them. You will remember the ones you use most often and you can always look up the other ones up. Here are all the elements you’ll most likely use:
Inline Elements
These elements display just like characters, coming one after the other horizontally, till it comes to the end of the line.
span
The span tag selects inline content.
So much information.
So much <span style="color: red;">information</span>.
strong
increases importance
So much information.
So much <strong>information</strong>
emphasis
for emphasis
So much information.
So much <em>information</em>
line break
Breaks the line without creating a new paragraph.
So much
information.
So much <br />information.
Inline Quotations
Quotations inside of a paragraph can get automatic quotes when you use this tag and the following CSS pseudo elements. (q:before {content: ““”; } q:after {content: “””; }).
So much information.
So much <q>information</q>.
Anchor Tag (Links)
The anchor element anchors a URL (uniform resource locator, or a unique web address) that targets the destination id or web page by using the href (hypertext reference) attribute.
Any tag can be a target, within any document on the world wide web. To target a tag, it has to contain an id <h3 id="anchor">.
To target the id, you need to use the id identifier, the hash tag # and the id name itself. <a href="#anchor">.
Hyperlink to destination on the same page
Click the example below and you’ll see the page jump just a little.
A hyperlink can address any unique webpage on the world wide web. It can use an absolute address, or a relative address, if the page is on the same server.
Absolute Hyperlink Address
An absolute address starts with http://, as in the address of the page that you are on (look up at the address bar)<a href="http://b.parsons.edu/~dejongo/01-writing-html5/">Writing HTML5</a>.
If the page is on the same server, it is possible to omit the absolute reference, and specify the path to the document from the location of the document containing the link.
The image tag gets replaced by the image. The img tag does not have a closing tag.
If the image is not at the location specified by the src attribute you will see a generic missing image icon.
There has to be an alt attribute so that text will appear if the image does not show up. The img tag will be flagged by the validator if it does not have an alt tag. The information is used by screen readers to explain what the image is about to blind people who listen to web pages. It is also a good idea for illustrators, designers, photographers and other people relying on images to load up the description of each image so search engines can include that in people’s searches.
The title attribute is optional. The title shows up when you hover over the image for a second or more.
<img src="image_location/name_of_image" alt=“required description of
image for screen readers or when images are turned off" title="Final Thumbnail" >
Comments
Comments are a way to add notes or hide code. Comments are not displayed by the browser. Use them to notate your document with a description of what’s going on in each part of the document.
Comments will help remind you why you did something a certain way (or help someone else figure out how to read your code).
You can also use comments to temporarily hide code that you do not want to use but do not yet want to delete.
Do not use two dashes in a row — within the comment, as that causes confusion in some browsers.
<!--
Comment your Work!
-->
Block-level Elements
Block elements display like paragraphs, coming one after the other vertically down the page in the document flow.
div
div stands for division. It is the generic block element, used when an element is needed for styling purposes, or as a convenience for scripting. The <div> element represents nothing, has no semantic meaning. Do not use in place of elements that have semantic meaning. It is not equivalent to the HTML5 section element.
content
<div style="background: pink; padding: 10px;">content</div>
Headlines
How a headline looks depends on how they are styled. You should use headlines to structure your content, not based on how they look.
<p>paragraph bla bla bla bla.</p>
<p>paragraph bla bla bla bla.</p>
Block Quote
Used to style quote that takes up an entire paragraph. It is indented and given a different style.
paragraph bla bla bla bla.
So much information.
<p>paragraph bla bla bla bla.</p>
<blockquote>So much information.</blockquote>
Thematic Break (Horizontal Rule)
Although previous versions of HTML defined the hr element only in presentational terms, as in horizontal rule, the element has now been given the specific semantic purpose of representing a “paragraph-level thematic break” which is to be styled using CSS. For legacy reasons, browsers still render the <hr> as a horizontal rule.
<h3>Ordered List</h3>
<ol>
<li> list item </li>
<li> list item </li>
<li> list item </li>
<li> list item </li>
<li> list item </li>
</ol>
Continuation of the Ordered List
If you plan on breaking the list into several lists but want them to be numbered sequentially, use the start attribute start="5". This would start the list at 5 instead of 1.
list item
list item
list item
list item
list item
<ol start="6">
<li> list item </li>
<li> list item </li>
<li> list item </li>
<li> list item </li>
<li> list item </li>
</ol>
Unordered List
Unordered lists is for a collection of unordered items, where the order would not change the meaning of the list. It is always used for navigation, with each menu item considered as part of the list. The unordered list is styled to remove the list style.
list item
list item
list item
list item
list item
<ul>
<li> list item </li>
<li> list item </li>
<li> list item </li>
<li> list item </li>
<li> list item </li>
</ul>
Definition Lists
Definition lists is for a list of terms and corresponding definitions. The term to be defined is listed first with the definition coming after the term. A term can have multiple definitions, and a definition can have multiple terms. A definition header can precede the definition.
List Header
Term 1
This is the definition of the first term.
Term 2
This is the definition of the second term.
<dl>
<lh>List Header</LH>
<dt>Term 1</dt>
<dd>This is the definition of the first term.</dd>
<dt>Term 2</dt>
<dd>This is the definition of the second term.</dd>
</dl>
The details disclosure element does exactly what you think it does. It toggles information that is initially hidden, disclosing it. It takes two tags, the <disclose> tag and the <summary> tag. The summary tag has a triangle in front of it that when clicked discloses the hidden information.
Details
Something small enough to escape casual notice.
<details>
<summary>Details</summary>
Something small enough to escape casual notice.
</details>
table
The HTML table layout mode allows authors to arrange data — text, images, links, forms, form fields, other tables, etc. — into rows and columns of cells.
A table can have a head, multiple table bodies and a table footer. You can span both rows and columns with the rowspan="2" or colspan="2" attribute. This allows for the header to expand down and the footer to expand across in the following example.
The Caption Holds the Title of the Table
Head 1
Head 2a
Head 3
Head 2b
table cell item
table cell item
table cell item
table cell item
table cell item
table cell item
table cell item
table cell item
table cell item
table cell item
table cell item
table cell item
The footer is a place for information about the table.
<table id="table">
<caption>The Caption Holds the Title of the Table</caption>
<col><col><col>
<thead>
<tr><th rowspan="2">Head 1</th><th>Head 2a</th><th rowspan="2">Head 3</th></tr>
<tr><th>Head 2b</th></tr>
</thead>
<tbody>
<tr> <td> table cell item </td> <td> table cell item </td> <td> table cell item </td></tr>
<tr> <td> table cell item </td> <td> table cell item </td> <td> table cell item </td></tr>
</tbody>
<tbody>
<tr> <td> table cell item </td> <td> table cell item </td> <td> table cell item </td></tr>
<tr> <td> table cell item </td> <td> table cell item </td> <td> table cell item </td></tr>
</tbody>
<tfoot>
<tr><td colspan="3">The footer is a place for information about the table.</td></tr>
</tfoot>
</table>
Iframe
An inline frame places another HTML document in a frame. The inline frame can be the “target” frame for links defined by other elements, and it can be selected by the user agent as the focus for printing, viewing its source, and so on.
The iframe is exhibited with attributes that are determined using the equivalent CSS in the demo width: 98%; height: 300px; border: 1px solid #f000; overflow: scroll;.
<iframe src="01-html-css-primer/">height=300 width=200 frameborder=1 scrolling=yes >You need a Frames Capable browser to view this content.</iframe>
You can target any page to appear in the iframe by naming it and using the target attribute with the name target="iframeDemo" as demonstrated above. Click on the links above to load different documents.
A destination anchor is used to position the Writing HTML document at the iframe section. That requires an anchor with the same name <a id="i-frame">. See the link tag above.
<a href="01-writing-html5/#i-frame" target="iframeDemo" >Writing HTML</a>
<a href="01-absolute-and-relative-addresses/" target="iframeDemo" >Absolute and Relative Addresses</a>
<a href="01-tools-of-the-trade/" target="iframeDemo" >Tools of the Trade</a>
HTML5 tags
Before HTML5, the generic markup elements, <div> and <span>, were used to mark up the page. That means the code itself had no way of determining what the content was.
HTML5 changed that.
HTML5 standardized a lot of best practices to create semantically relevant block level tags that help organize the document. It is now possible to tell header content from the content of an article by looking at the tags alone. The most important of the new elements are: <main>,<section>, <header>, <nav>, <article>, <aside>, <footer>, <figure>, <figcaption>, <hgroup>, <wbr>.
Document Layout
<main>
<section>
<header>
<hgroup>
<h1>Name</h1>
<h2>Name</h2>
</hgroup>
</header>
<article>
<p>content <wbr> content</p>
the <wbr> tag, or Word Break Opportunity tag, is an inline tag that specifies where in a text it would be ok to add a line-break.
<aside>
<p>content</p>
</aside>
</article>
<footer>
</footer>
</section>
</main>
Adding Navigational Links
Using an unordered list.
<nav>
<ul>
<li><a href="#">link to homework</a></li>
<li><a href="#">link to homework</a></li>
<li><a href="#">link to homework</a></li>
</ul>
</nav>
Copy and paste this basic HTML5 template into a blank Textwrangler file. It has most of these elements and a basic header, so you can start coding the content right away. Repetition will acclimate you to writing HTML.
In 1945 Vannevar Bush published an article, As We May Think that helped set the stage for the pioneers who actually developed hypertext, twenty or so years later. By then, the future of the internet could more or less be predicted.
Apple comes out with the Macintosh computer in 1984. A few years later in the mid 1980’s it releases HyperCard for free to all Macintosh users, a condition specified by its creator, Bill Atkinson. Hypercard instantly provided a simulation of what the web would be in easily editable hyper-text stacks. It was a successful hypermedia forerunner to the WWW. It came with a programing language called HyperTalk that is the inspiration for javascript.
Apple’s HyperCard was used to implement an AppleTalk networked based hypertext information database system in the office of CERN where Tim Berners-Lee developed the WorldWideWeb, the very first browser to edit and see what would become the world wide web. Here is the first web site.
Tim Berners-Lee created the browser on a Next computer, using its innovative software to both render and edit web pages. It was later renamed Nexus, to differentiate it from the World Wide Web, and was released as open source in August 1991.
The World Wide Web
The very first popular browser was also inspired by HyperCard. ViolaWWW was developed that same year, and was an attempt to recreate HyperCard in X Terminals. ViolaWWW was adopted as the basis for the Web’s development till Mosaic was released, which was the first widely adopted web browser.
Netscape Navigator was created by the same people who created Mosaic, and was released just as the internet was coming out of the universities and into the public realm. Its popularity exploded and by 1994, industry pundits talked about the birth of a new ubiquitous computer experience that would be computer platform agnostic.
I still remember the heady claims in 1995, that this new medium would undercut Microsoft’s monopoly and that everything would be moved onto the web. Remember, all we had back then were slow and finicky modems that the changed the data-stream into sound, so any communication was very slow.
This challenged Microsoft’s bid for world domination, and it quickly licensed code from Mosaic to build Internet Explorer, bent on making sure that this new paradigm would never happen, or if it did, that it would be on their terms. This resulted in the historic fight for control of the web: Netscape Navigator vs Internet Explorer.
Web Standards
At the time, the visual presentation of the content was delivered by the HTML tags themselves, generally using frames and tables. Pictures took a long time to download, so they were carefully optimized and used sparingly.
CSS1 was introduced in 1996 to separate the presentation from the markup, and was further refined by the release of CSS2 in 1998. The browser manufacturers were slow to integrate these standards, as they were too busy adding proprietary features to ensnare users.
Microsoft’s forceful ways worked. It trounced Netscape Navigator’s domination of the web browser market. Internet Explorer reached 93% market penetration by 2003.
It did this by leveraging its 95% of installed computer operating system base to lock users in. Microsoft gave Internet Explorer proprietary access to the rest of the operating system.
Some think that it almost committed suicide by tying the browser into the Windows Operating System. Microsoft made the entire operating system vulnerable to all kinds of hacks.
Having lost the battle, Netscape Navigator gives up. With the race won and no competition, Microsoft stops development of Internet Explorer with version 6.5, having achieved a monopoly, but the victory would not last. Standards compliant browsers slowly began to make inroads into Microsoft’s world domination.
CSS 2.1, released in 2002, further refined this standard. It was fully embraced by the new browsers on the market.
Apple released Safari in 2003 and Firefox was born out of the ashes of what was left of Netscape Navigator in 2004, and Opera was there as well. This adoption is the beginning of standards based web design so prevalent today.
You can read the story as a comic strip presented below:
The New World
The plan was to sock it to Microsoft by creating stable web applications that could challenge both Microsoft Office and the Windows operating system. With web applications, the new paradigm would make the operating system underneath agnostic, not just for web pages, but for all computer usage.
That was the design goal of HTML5. Google developed Chrome, a browser where each window runs independent from other windows, bringing operating system like stability to the browser for the first time.
The next evolution is a change from computer based browsers to all kinds of handheld devices. Apple’s iPhone, iPad and Google’s Android operating systems are essentially internet devices that replace the desktop computer. To this end, both Apple and Google contributed much to the new HTML5 and CSS3 standards.
This is what Microsoft was afraid of, for its office suite and windows operating system generated most of its money. Though still a lumbering giant, Microsoft is no longer the monopoly it once was, and it decided to get on board.
Everyone wondered what was up when it released a public beta of a mostly standards compliant IE 9. It has since shown that is committed to open standards by releasing the IE10 beta right on the heels of IE 9.
It has joined in, helping to create new standards. That’s a solid affirmation that the future belongs to open, standards compliant computing.
The following two videos and the Zen Gardens web site are a snapshot of what the web was like in 2003. Molly E. Holzschlag demonstrates what the web looked like before CSSand after. This new world was brought into focus by the CSS Zen Gardens web site, which demonstrated the power of CSS with the separation of content from form.
The Existing Standards
While development of Internet Explorer stood still, a new crop of browsers aimed toward compliance of the HTML4, XHTML and CSS 2.1 standards, as set forward by the W3 organization, which brings us up to today.
The New Standards
Very exciting changes are here with the next generation, HTML5 and CSS3. This is, in part, because more and more interface elements are being created with HTML5 and CSS3, like the iTunes store interface, iOS apps, Android and others, so it’s possible that in the future, most interfaces will be using this most universal of languages, which places the scope of you learning HTML5 and CSS3 well beyond the browser.
Write a sentence or two expressing what you hope to achieve this semester. Include something about the teaching style that aligns best with how you learn. Are you a self learner or do you prefer everything to be structured? You will post this on the landing page you will create next week in class.
What do you Hope to Achieve Professionally? Discuss this with A.I.
Explore and strategize your future, or at least, how you plan to prepare for it by the time you do your graduation exhibition. Use OpenAI: chat or any of the many other AI large language model chats. Follow the Open AI v.3 example. Place it at the bottom of the landing page.
Your Presence on the Web
The web is a medium, like print or video. The web as medium is fluid like water running down the creek or sand held in by the walls of an hourglass. Communication and design is responsive to the many devices that may exhibit the work (from a tiny watch to the largest screen) and many circumstances as the mobile experience can happen anywhere. Print and video are passive in comparison. Web design can reach out and grab its audience through behaviors that elicit responses tailored for interactive engagement. This makes web design immediate, dependent upon satisfaction and gratification or the user will click away. A lot goes into web design.
Assignment #1: Pick a Website to Inspire Your Portfolio, and analyze it
You are to make a website. To make it stand out, pick a website that you find compelling, and analyze it. Please read Why do most websites all look the same? This is an opportunity for you to stand out. Differentiate your work. Your career depends on it.
The midterm assignment is to sell yourself. This homework is part of the research you will do for the second of seven steps of next week’s assignment, Designing for the WebChoose a professional website that represents your aspirations. For example, if you’re a photo major, pick a photographer’s website. It should be a website that represents the future you want to build for yourself.
Once you have found website(s) that represent your aspirations, analyze it. This is the starting point for thinking about your own portfolio.
Articulate who the primary target audience is. The content strategy? How should the navigation work? The visual design? Answering these kinds of questions makes you aware of the elements that go into building your own portfolio. Writing them down provides you with content to mark up.
Ideally, you become more focused on delivering your work to your target audience. That will help you focus your work in ways that can only benefit you as you leave Parsons for the real world. In the mean time, you can prepare for that day by learning to build good websites.
Intent: What is the intent of the website? Use the intent to inform all of the other qualities. This should be a short and concise statement, as in to sell skills.
Voice: What is the voice of the website? Is the site’s voice impassioned, assured, energetic, or conversational? Pick a number of descriptive adjectives that capture the experience that whoever had the site built attempted to convey the intent.
Tone: Whereas voice is consistent for the site as a whole, the tone is a contextual refinement that helps convey the content. An about page may have a different quality about it than the home page or a page in the shopping cart.
Brand: How does the website establish its brand? Is it consistent? Is it upscale, casual, youthful, objective?
Persona: Think of the many different users this website is addressing. If we were to write down the characteristics of any of these users and the label them, we would create a persona. Personas are composite sketches that reflect real-world behaviors, attributes, and attitudes of end users.
You can start with yourself, as you are one of the audiences targeted by the website. Take, for example, Naoto Fukasawa‘s website, a Japanese industrial designer. The audience can be personas representing museums, corporate clients, architects that may use his products in their work, end users, students doing assignments for a web basics class, and the list goes on.
Create 3 Personas: Personas are composite sketches that reflect real-world behaviors, attributes, and attitudes. Create a character sketch for at least three personas.
Go into the details why they would be attracted to the site, how the site informs them, and what can they do with this information. Would each of these people come back and be a repeat customer? Show how the site addresses these concerns.
Tell a story, assign each of these personas a name and personal details. By making them real, you can visualize the audience and walk them through the website. Stories activate many areas in the target audience’s brain, facts do not.
Copy Deck: In developing a website for a client, the content is often done by different people and the designer requires that all the copy for the website be assembled into a copy deck. Copy the content of the first page, break it down and label it as if it were part of a copy deck. Take a look at the SAMOCA copy deck example for guidance.
Competition: How does this website stack up against the competition? What does it have that competitor websites do not, in terms of voice, tone, brand, style, design and so on? Can anything be learned from the competition?
This exercise is meant to get you into the development process of building a website — your portfolio!
You will mark up your answer and create an index.HTML page with links and linked images that you will bring to class next week.
Posting the Assignment on your Domain
You will post the assignment on the b.parsons.edu server. Some of you may not gain access to this server right away. don’t worry about it. Just do the work and you will get on soon enough.
Turn to the Tools of the Trade article for instructions on how to set up your website.
Put a “parsons” folder inside the public_html folder.
Fetch acts like a finder window, so when you drag files into the window, they end up on your server. Unlike your finder, you replace the file when the names are the same. This is how you update files to a newer version.
Within the “parsons” folder, create a folder called “assignment-1”. The title of your web site profile should be “index.html”. It should end up in the “assignment-1” folder.
Review Writing HTML article to help you create the HTML file. I have an old assignment as a homework sample.
These videos (about half an hour) are much more fun and direct than my lectures or the Lynda.com videos. Many if not all of your basic questions will be answered by listening to either my lecture or watching these videos. Please let me know in class or email me if there is still something that is not clear. To go on without resolving what is not clear will cascade into many problems later on.
The web changed completely when it comes to typography. For the first twenty years we could specify only a few fonts. There were 18 fonts to use in 2008. The core fonts licensed by Microsoft are: Andale Mono, Arial, Arial Black, Comic Sans MS, Courier New, Georgia, Impact, Times New Roman, Trebuchet MS, Verdana, Webdings. Apple added Helvetica and Times. That was it. By 2010, there were thousands of fonts available. What a change. Since then they introduced open type variable fonts.
While typography’s been around for hundreds of years, it’s only been in the last hundred years or so that it became both art and science. The art and science of typography forced typographers to ply their craft in the service of the end user who reads it. That makes them the original user experience designers, so take heed.
The web is different from print. The user is in charge in a way that is foreign to print. The attention span is different, and the typography should facilitate the user experience as soon as they arrive on the page. The typographic defaults that taken for granted took their shape from the years of experience in the print world. Do not blindly accept these defaults by which to express your content on the web. The web is different from print.
You will be required to deviate from the standard web fonts like Arial, Helvetica, Verdana and Georgia in the final. These are common fonts supplied by the operating system that have defined typography on the web for far too long. They are safe, legible and entirely predictable. It is possible that legibility may suffer in favor of better expression of the content. It’s a brave new world. Please push the typography if you can. It has been documented that legibility isn’t all that its been cracked up to be when it comes to retaining information.
On the one hand, the legibility of a typeface is its invisibility, that is, just like the cuts in a movie and they are not supposed to draw attention to themselves but convey the content in service to the story. The typeface and the way it is laid out should transparently facilitate the content to the user, whose focus, after all, is on what is being said. But if you want the delivery of the content to express something, it better have style. It’s possible to do both, and in the name of communication, even if you forgo some legibility, I encourage you to do so for the sake of communication, if that is what it takes.
David Carson famously did this twenty years ago, designing, among other things, covers for HOW magazine which I was writing for. If we need an expanded vision to counterbalance all of the rules, we can visit his work, with the understanding that rules are meant to be broken, with intelligence and purpose, and if the content demands it.
Honor the content with your typography, so that it aids in the facilitation of that content. After all, it is only through reading the letterforms that the content can be transmitted. As a designer, you have the power to determine that gateway.
Balance function and beauty, or whatever emotion grabs you to fulfill that function with style. Be playful, lively, think your way through the problem but let the solution be surprising, and just have fun! Having fun is contagious, and if you exhibit joyful creation, it is bound to be infectious.
Here’re two spreads on intuition from David Carson’s 2nd Sight, his influential book on graphic design after the end of print. There is a TED talk and another one of his creations in the homework. Let that get you started.
The Fundamental Skill of a designer is talent. Talent is a rare commodity. It’s all intuition. And you can’t teach intuition. — Paul Rand
Intuition doesn’t look at things as they are: that is prison, that is anathema to the intuitive. He looks, oh, so ever so shortly at things as they are and moves off into an unconscious process, at the end of which he has seen something nobody else would have seen — C.G. Jung
CSS or Cascading Style Sheets makes life easy. There are two parts, the rules and the cascade. The rules give form to the content. The cascade connects the rules to targeted HTML elements. All the rules for the website are located in one external style sheet making it easy to change the site as a whole.
It’s possible to avoid the cascade by writing all the CSS rules inline. That would be painful. It becomes even more painful if the site is to be revised. Unlike Print, websites are in a continual state of revision. It is possible to embed styles in the head of an HTML document. This is great for writing style definitions once and applying them many times throughout the page. If there are more pages, however, it’s better to separate the styles out of the document into an external style sheet. A link to that stylesheet in the head of the HTML page keeps it in synch with the external style sheet.
Imagine updating your whole site by changing only one rule. That is the power of CSS!
The Bright Side
Using a single stylesheet is a boon for consistency.
A reduction in repetition and file size.
By separating form from content, the content can be repurposed to work on watches, phones, tablets and computer screens. This is called responsive web design.
Build fantastically complex web pages with relative ease.
Ease of revisions to the layout.
CSS allows for better Search Engine Optimization. You can put the most important information first no matter where it ends up being on the page. Content remains readable compared to using tables for layout purposes.
The Darker Side
The cascade can become confusing as the number of style definitions grow.
Leave out one character and the whole thing can break down. More usually, only the declaration breaks down but watch out for errors by validating often.
Quick Peek
The browser allows you to apply any inline CSS style to any object just for the page you are looking at. Open up the inspector in Chrome — right-click on the object you wish to investigate and select inspect. Once the new window opens up, navigate to the top of the left sidebar and right below the Filter box you will see: a javascript function that will insert whatever inline CSS style you want on the selected element.
element.style {
}
Here you can add any style to the selected element. This style will disappear as soon as the page is refreshed but it allows you to see what a style would look like. The left column, when looking at elements, provides a detailed description of all the css used to paint this object. You will be exploring this feature the more time you spend coding. The same feature is available in Safari and Firefox.
CSS is hard because its properties interact, often in unexpected ways. Because when you set one of them, you’re never just setting that one thing. That one thing combines and bounces off of and contradicts with a dozen other things, including default things that you never actually set yourself.
One rule of thumb for mitigating this is, never be more explicit than you need to be. Web pages are responsive by default. Writing good CSS means leveraging that fact instead of overriding it. Use percentages or viewport units instead of a media query if possible. Use min-width instead of width where you can. Think in terms of rules, in terms of what you really mean to say, instead of just adding properties until things look right. Try to get a feel for how the browser resolves layout and sizing, and make your changes and additions on top of that judiciously. Work with CSS, instead of against it.
Another rule of thumb is to let either width or height be determined by content. In this case, that wasn’t enough, but in most cases, it will be. Give things an avenue for expansion. When you’re setting rules for how your elements get sized, especially if those elements will contain text content, think through the edge cases. “What if this content was pared down to a single character? What if this content expanded to be three paragraphs? It might not look great, but would my layout be totally broken?”
CSS is weird. It’s unlike any other code, and that makes a lot of programmers uncomfortable. But used wisely it can, in fact, be awesome.
The 404 or Not Found error message is a HTTP standard response code indicating that the browser was able to communicate with the server, but the server could not find what was requested.
The web site hosting server will typically generate a “404 Not Found” web page when a user attempts to follow a broken or dead link; hence the 404 error is one of the most recognizable errors users can find on the web.
Customize the 404 page, or file not found error message, so it is not generic, but reflects the identity of the website.
Not found 🙁
Sorry, but the page you were trying to view does not exist.
It looks like this was the result of either:
a mistyped address
an out-of-date link
<!doctype html>
<title>Page Not Found</title>
<style>
body { text-align: center;}
h1 { font-size: 50px; text-align: center }
span[frown] { transform: rotate(90deg); display:inline-block; color: #bbb; }
body { font: 20px Constantia, "Hoefler Text", "Adobe Caslon Pro", Baskerville, Georgia, Times, serif; color: #999; text-shadow: 2px 2px 2px rgba(200, 200, 200, 0.5); }
::-moz-selection{ background:#FF5E99; color:#fff; }
::selection { background:#FF5E99; color:#fff; }
article {display:block; text-align: left; width: 500px; margin: 0 auto; }
a { color: rgb(36, 109, 56); text-decoration:none; }
a:hover { color: rgb(96, 73, 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }
</style>
<article>
<h1>Not found <span frown>:(</span></h1>
<div>
<p>Sorry, but the page you were trying to view does not exist.</p>
<p>It looks like this was the result of either:</p>
<ul>
<li>a mistyped address</li>
<li>an out-of-date link</li>
</ul>
</div>
<script>
var GOOG_FIXURL_LANG = (navigator.language || "").slice(0,2),
GOOG_FIXURL_SITE = location.host;
</script>
<script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
</article>
I expect you to use your root — public — directory for your own purposes. You will create a new folder and call it parsons (lowercase p) in the root directory. That is where you will develop all of your work for this class. As there is a midterm with associated assignments and a final, create two folders a portfolio and a final folder.
Web Site Organization
Index.html and Worksheet.
You will create an index.html page inside of the parsons folder that will contain the links to each of your assignments. You will place a photograph of yourself, along with your name, so I can associate your work with you as a person.
The index.html in the portfolio and final assignment folders will serve as your worksheet. This is where I expect you to document your creative development. See example. Update these files in a timely manner!
I expect your class web space to be organized exactly like this or I cannot review your work.
The web space for each student needs to work exactly the same. This is how I make contact with your work. I will be going to this page to check up on your progress once a week, so keep it current. Your grade depends upon it. Homework needs to be up the day before — so I have a day to check it before teaching, for issues that need to be addressed in class.
Even if you are not finished with the homework, upload it and show me what you have, even if it is not finished. You work is due on time, and you can revise it according to the syllabus, until the 12th week of the semester. Work not handed in on time will be graded at my discretion.
The web is a design language, and as some of you are not primarily Communication Design students, it becomes clear that there needs to be a reference that covers what Visual Design students take for granted.
Parsons students can use these links as resources for researching their projects. Visual literacy goes beyond how something looks. It makes communication more effective.
Visual literacy is used to solve problems in communication. This is a lot like structuring an argument in the academic essay, where reason supplants opinion. Instead of finding causes and reasons why, or a genealogy, bringing visually literate structuring to the communication makes the message more engaging, apparent and clear.
To that end, I’ve assembled a number of links to help develop visual literacy.
A Modernist design manual
Designer Massimo Vignelli’s life’s work through his design philosophy with a wealth of examples in The Vignelli Canon. He distributed it free on his website for everyone to become better visually educated. That site no longer exists, so I put the book on my server. You can purchase it. The Vignelli Canon represents the status quo that David Carson opposed that we will cover in Week 6)
Design Inspiration
Use the following resources to explore your site design. Be inspired — copy, borrow, steal — but make sure that whatever you take, you make your own. The top priority is to effectively communicate the content.
Canva is an online graphic design platform that lets nondesigners put together and play with designs till something clicks. You can use it instead of photoshop to prototype your design. Download it as a PDF and open it in Illustrator, and all of the elements are editable.
Invision is a web and mobile device application design platform that allows you to create and user test your designs before you commit to them with code.
Web design layout strategies continues to change, from what it was at its inception to today, and from where it is today into the future. You have to go along with those changes. It started out as a presentation language for static documents written by scientists. That changed when the general public got a hold of it, but for the first twenty years, the size of the page was pegged to the size of a computer screen.
The iPhone revolution changed web design, and a web page is expected to perform equally well on many different devices, from smart phones and tablets to computer screens, car entertainment devices, and more.
Design for the web today has to cover all the differs devices with the same content and CSS. Think of web content as a flexible material that automatically adapts to different sized devices. Each device has its own characteristics, from the small pointer on a computer screen to the large finger on a smartphone.
It means that you cannot design for your laptop screen and hope it works on the other devices. You need to address the target audience for each device. This takes some time. You’d want layout functionality that automatically arranges the content in different ways, depending on size and function. You can trust that a person behind a desktop will sit there, but the person with a smartphone is probably on the go. You need to put your head in the right place when you design for the web.
There are automated formatting systems available that make it easier to place things in the right position for different user experience based on device size. Flex-box was introduced to create a more flexible layout experience. While flexbox allows you to choose both horizontal and vertical directions, it is most appreciated for its ability to organize content going across the page.
Nesting flex boxes allows for great horizontal or vertical placement using the margin:auto; property. This automatically places content at the top, bottom, left, right, or center of the parent object. Flex Grow, Shrink, and Basis provide controls that dynamically determine the proportion between the content items. It fits the flex-items to the remaining space, or lack of space as determined against a reference basis width, using grow, shrink and basis controls.
CSS grid does that flex box does, but in both horizontal and vertical directions at the same time. Grid is very flexible in laying out content and can automatically lay out content. It is actually possible to build a responsive website using CSS grid without using media queries.
The History
The CSS working group is finally addressing layout. For 20 years layout in CSS was an afterthought and designers had to be creative with the tools they had. Those days are behind us. New tools change the way we lay documents out.
The new tools and techniques augment the old layout strategies, superseding many of them. That does not mean these older properties and techniques disappear. They will have less to do, perhaps, in the grand layout scheme of things. As the new tools gain traction there will be a divergence from layout techniques before 2018: the Layout Modes, Floating Layouts, and Beyond Floats.
Tables were used in the prehistoric age before 2003. This admixture of form and content locked in the structure of a web page with its content and was never flexible. That may not have been a problem in the early days of the web when the computer screens were all pretty much standard but it would be a problem today. I recently stumbled on an old legacy table based website: Muhammad, Legacy of a Prophet on PBS. It is an example of a page designed in Photoshop and cut up into a table layout. This no longer happens.
Between 2003 and 2007 there was an attempt to develop the holy grail of web design, a CSS based perfect three-column layout using floats. The NY Times created its layout using CSS floats instead of table and pictures. Floats are less intuitive and more fragile than tables but they are more flexible as they separate form from the content. Who could have guessed that floats, originally conceived to run text around images and other elements would be used to power grid systems like Bootstrap constructing the majority of the web pages from 2007 to 2017. Bootsrap has been updated to use CSS flexbox instead.
The idea for Flex Box has been around since before 2008. By 2009 it was a working draft. Changes in the syntax kept it from becoming mainstream till after 2015. Flexbox is flexible, but it’s still just one dimension, either horizontal or vertical. For two dimension, both horizontal and vertical, you need the CSS Grid module released in 2017. Browsers adopted grid just a month after the standards committee released it, paving the way for era of modern web layout. Layout will become more automated, moving away from absolute and relative measurements toward flex spaces that automatically fit the content into whatever liquid layout may present itself.
The Basics
The different parts of CSS layout are tools. The better you know these tools, the more effective your layouts will be. The basics have to be understood before using flex and grid so we cover them first.
Inline
Inline follows the text flow inside the block element. Depending on the language, it can flow from left to right, right to left, top to bottom, or bottom to top.
Block elements: Down is Easy
Block elements automatically extend to the width of their parents and push content down. This is called Normal Flow. Normal Flow is how the browser lays out HTML pages by default when nothing is done to control page layout. Documents are built as if stacking building blocks upside down. Starting at the top, you work your way down. Each block automatically fills to the width of the parent.
The normal flow is used throughout the layout process and should be respected no matter what layout strategies used.
Horizontal Layout is More Problematic
All of the traditional layout strategies work to build elements horizontally by limiting the width of one element to something smaller than the parent element , and then using one or another strategy to place boxes (blocks) next to one another. It is necessary to limit the width of elements that would otherwise automatically fill up the entire width of the parent element, to something that fits within the parent element.
An exercise we will do in class is to look at the NY Times using Web Developer’s outline feature (this works only in Chrome or Firefox). You will see the following methods being used to determine the horizontal layout, starting with floats:
Each of these layout methods is demonstrated below. Try them out. Combine them in various strategies to create layout.
Floats
Applying a float value such as left can cause block level elements to wrap alongside one side of an element, like the way images sometimes have text floating around them in magazine layouts.
CSS Code View
Live Demo
Box A:
It is a testament to the creative problem solving of the CSS community that refined these techniques to the point where they will remain current for a long time.
This paragraph will either join the one above or clear: left; will clear the float.
Relative Positioning (using negative margins)
Positioning allows you to move an element from where it would be placed when in normal flow to another location. Positioning isn’t a method for creating your main page layouts, it is more about managing and fine-tuning the position of specific items on the page.
CSS Code View
Live Demo
Box B:
Box C: This box is positioned relative using negative margins.
Box D:
Absolute Positioning (with Margins)
CSS Code View
Live Demo
main content
Display Property Interactive
Display property is assigned by default to different elements making them inline, block, list, or table. Using the display property you can resign the display value of any element, from block to inline, for example.
CSS Code View
Live Demo
Box A:
Box B:
Box C:
Box D:
Creating layouts
Horizontal and vertical techniques are combined to create more complicated layouts. You will use one strategy to get the box to the side, another to populate it with content, and so on.
The inline content itself fills out the layout and expands the box (block) that its in.
The placement of elements is manipulated through relative and absolute positioning, floats and the display property, and given padding and margins so they fit the layout.
Absolute positioning, as used by Indesign and Illustrator, for example, is not a good layout strategy when it comes to the main elements of the website. It works well for print because, once a job is printed, that’s the end of the story. Web sites are continually viewed in different viewports and require a much more flexible approach. That is the key word here: flexibility.
That’s why the word processor is a better metaphor, as the content starts at the top of the page and is pushed down the page. Absolute or fixed positioning can be used to nail down details of the design but not the main parts of the layout.All elements need to be flexible enough to go along with the flow.
Positioning the Page in the Window (ViewPort)
The first decision is to place the document in the window. Does it take up the whole window? What if the window is 2400px wide? Does it take up a 1000px width in the middle of such a large screen? or does it stay to one side, ignoring the size of the window once it passes 1300px?
This requires a solution with at least two blocks; the first is a div with a class called wrapper, and the second is the sections tag. The div is needed to limit the maximum width of the window to 1300px, and the section determines the width of the page as well as horizontally centering itself inside of the wrapper. This is the strategy used in the HTML5 template and gone over step by step in setting up the page in the demonstration.
With the width of the page decided, the process now goes from the top of the section. First comes the header, then the navigation (the navigation is often nested inside of the header) then comes the main article with usually an aside to the right or left of it, and finally, a footer to define the bottom of the page.
If all of these are in the document flow, and determined by the size of the content, then the document is flexible, meaning that if something were to be added somewhere in the middle, it would be accommodated in the document flow, and everything else would adjust accordingly.
Building flexible documents is the ideal. Please aim for that, as it will make your documents much easier to manage. We have not yet covered responsive design using media queries but when we do, the document has to remain flexible so it can adapt to different size viewports, or window sizes, from the tiny screen of the iPhone to the largest monitors.
If you think it is hard to manage a static page, just imagine how much more difficult it would be to manage various states of the same document. Lets make our documents flexible for now, and worry about responsive layouts after the midterm.
Fixed Layouts
A fixed layout has pixel-based widths for the whole page and for each column of content. Its width doesn’t change when viewed on smaller devices like mobile phones and tablets or when a desktop browser window is reduced.
Fixed layouts are easiest when first learning CSS but are limited in addressing the many variable viewports.
Fluid Layouts
A fluid ( or liquid) layout uses percent-ages for widths, allowing the page to shrink and expand depending on the viewing conditions.
Elastic layout can use ems for both width and all other property sizes, so the page scales according to a user’s font-size settings.
There is no single layout strategy that is right for every circumstance, and you will find yourself using all of the CSS layout tools at one time or another.