wk2.0

Plan for this week: Dipping our toes in front-end development

History (via wikipedia)

The historic logo made by the W3C

Development[edit]

Tim Berners-Lee</div> </div> </div>

In 1980, physicist Tim Berners-Lee, who was a contractor at CERN and helped to create the first dating site in 1995, proposed and prototyped ENQUIRE, a system for CERN researchers to use and share documents. In 1989, Berners-Lee wrote a memo proposing an Internet-based hypertext system.[3] Berners-Lee specified HTML and wrote the browser and server software in late 1990. That year, Berners-Lee and CERN data systems engineer Robert Cailliau collaborated on a joint request for funding, but the project was not formally adopted by CERN. In his personal notes[4] from 1990 he listed[5] "some of the many areas in which hypertext is used" and put an encyclopedia first.

Get your moss here!

The first publicly available description of HTML was a document called "HTML Tags", first mentioned on the Internet by Berners-Lee in late 1991.[6][7] It describes 18 elements comprising the initial, relatively simple design of HTML. Except for the hyperlink tag, these were strongly influenced by SGMLguid, an in-house Standard Generalized Markup Language (SGML)-based documentation format at CERN. Eleven of these elements still exist in HTML 4.[8]

HTML is a markup language that web browsers use to interpret and compose text, images and other material into visual or audible web pages. Default characteristics for every item of HTML markup are defined in the browser, and these characteristics can be altered or enhanced by the web page designer's additional use of CSS. Many of the text elements are found in the 1988 ISO technical report TR 9537 Techniques for using SGML, which in turn covers the features of early text formatting languages such as that used by the RUNOFF command developed in the early 1960s for the CTSS (Compatible Time-Sharing System) operating system: these formatting commands were derived from the commands used by typesetters to manually format documents. However, the SGML concept of generalized markup is based on elements (nested annotated ranges with attributes) rather than merely print effects, with also the separation of structure and markup; HTML has been progressively moved in this direction with CSS.

Berners-Lee considered HTML to be an application of SGML. It was formally defined as such by the Internet Engineering Task Force (IETF) with the mid-1993 publication of the first proposal for an HTML specification: "Hypertext Markup Language (HTML)" Internet-Draft by Berners-Lee and Dan Connolly, which included an SGML Document Type Definition to define the grammar.[9] The draft expired after six months, but was notable for its acknowledgment of the NCSA Mosaic browser's custom tag for embedding in-line images, reflecting the IETF's philosophy of basing standards on successful prototypes.[10] Similarly, Dave Raggett's competing Internet-Draft, "HTML+ (Hypertext Markup Format)", from late 1993, suggested standardizing already-implemented features like tables and fill-out forms.[11]

After the HTML and HTML+ drafts expired in early 1994, the IETF created an HTML Working Group, which in 1995 completed "HTML 2.0", the first HTML specification intended to be treated as a standard against which future implementations should be based.[12]

Further development under the auspices of the IETF was stalled by competing interests. Since 1996, the HTML specifications have been maintained, with input from commercial software vendors, by the World Wide Web Consortium (W3C).[13] However, in 2000, HTML also became an international standard (ISO/IEC 15445:2000). HTML 4.01 was published in late 1999, with further errata published through 2001. In 2004 development began on HTML5 in the Web Hypertext Application Technology Working Group (WHATWG), which became a joint deliverable with the W3C in 2008, and completed and standardized on 28 October 2014. [14]

So what does HTML look like? You're looking at it!

Getting started: hello world

Type this in your editor

Hello world! 

This is my first web page.

Save it as hello.html. Open it in browser.

Tags, attributes, and elements

Tags

  <!DOCTYPE html>
    <html>
      <body>
        This is my first web page
      </body> 
    </html>
</code>
  • The first line on the top, <!DOCTYPE html>, is a document type declaration and it lets the browser know which flavor of HTML you’re using (HTML5, in this case). It’s very important to stick this in - If you don’t, browsers will assume you don’t really know what you’re doing and act in a very peculiar way.

  • <html> is the opening tag that kicks things off and tells the browser that everything between that and the </html> closing tag is an HTML document. The stuff between <body> and </body> is the main content of the document that will appear in the browser window.

  • Not all tags have associated closing tags. Tags that contain no content are void tags and do not need to be closed.

Ex. The <br> tag (see below).


Attributes

Attributes contain two parts:

  • A name
  • A value

Ex.

Hello world!

Bonjour le monde!

Elements

Elements are everything in between (and including) the tags.

Anatomy of html

<body>

<head>

<title>

Two types of markup

  • Structural markup: the elements that you can use to describe both headings and paragraphs
  • Semantic markup: which provides extra information; such as where emphasis is placed in a sentence, that something you have written is a quotation (and who said it), the meaning of acronyms, and so on.

Structural markup

Headings

<h1>

<h2>

<h3>

<h4>

<h5>

<h6>

Paragraphs

<p>

Bold & Italic

<b> and <i>

Superscript & Subscript

<sup> and <sub>

Whitespace collapsing

Line Breaks & Horizontal Rules

<br> and <hr>

Note that we don't close these tags. <br> and <hr> are examples of empty elements.

Semantic markup

Strong & Emphasis

<strong> and <emph>

Quotations

<blockquote> and <q>

Both elements may use the cite attribute to indicate where the quote is from. Its value should be a url.

Abbreviations & Acronyms

<abbr>

Uses the title attribute (don't forget the quotes!).

Citations & Definitions

<cite> and <dfn>

Author Details

<address>

The <address> is to contain the author's contact details. It can contain a physical address, or a phone number, or email.

Changes to Content

<ins>, <del>, and <s>

The <ins> element is for showing that content has been inserted into the document while the <del> tag is for showing deleted content.

It was the worst best idea she ever had.

The <s> tag is for indicating that something is no longer accurate or relevant (but should not be deleted).

Laptop computer:

Was \$995

Now only $375

Unordered and Ordered Lists

<ul>, <ol>, and <li>

  • Makin' a list
  • Checkin' it twice
    1. Check 1
    2. Check 2

Links

<a>

The anchor tag requires a value, href, that is set to a URL.

Click me!

Anchor tags can be absolute or relative.

Note: Just about any tag can have an id value (ex Do you need moss?)

Images

<img>

<img src="https://upload.wikimedia.org/wikipedia/commons/d/d8/Sphagnum_-_moss_-_Moos_01.jpg" width="500" height="400" alt="Some moss">

Note: The image tag requires an html src value. You should also put a width and height value if you don't want your image loading in weird ways.

Tables

<table>, <tr>, and <td>

Row 1, cell 1 Row 1, cell 2 Row 1, cell 3
Row 2, cell 1 Row 2, cell 2 Row 2, cell 3
Row 3, cell 1 Row 3, cell 2 Row 3, cell 3
Row 4, cell 1 Row 4, cell 2 Row 4, cell 3

Challenges

  • On your own, work through the Wikiversity HTML design challenges (link: https://en.wikiversity.org/wiki/Web_Design/HTML_Challenges) up to challenge 5 (I'll be doing a python review in a bit. If you feel pretty good about functions and loops, feel free to skip. I've put some python challenges in ../extras. The challenges go over some questions that you would see in a software engineering interview. Give those a try).

You might find it helpful to read HTMLdog's guide to HTML while working on the challenges: http://htmldog.com/guides/html/

Additionally, check out our HTML and CSS books for reference (they're what I used)


In [ ]: