Setup and Environment

Web Architecture and Information Management [./]
Spring 2009 — INFO 190-02 (CCN 42509)

Erik Wilde, UC Berkeley School of Information
2009-01-26

Creative Commons License [http://creativecommons.org/licenses/by/3.0/]

This work is licensed under a CC
Attribution 3.0 Unported License
[http://creativecommons.org/licenses/by/3.0/]

Contents E. Wilde: Setup and Environment

Contents

E. Wilde: Setup and Environment

(2) Abstract

This lecture provides a hands-on overview of the various tools that are required to create and publish Web pages. This includes authoring a Web page, transferring the page onto your Web space on the Web server, and validating the Web page. For a more detailed look at the Web page in the context of the browser, the Firebug extension allows Firefox users to understand in detail how a Web page is structured and styled.



E. Wilde: Setup and Environment

(3) Assignments



Web Server Configuration

Outline (Web Server Configuration)

  1. Web Server Configuration [5]
  2. HTML Basics [11]
    1. Elements [2]
    2. Element Structures [5]
    3. Attributes [3]
Web Server Configuration E. Wilde: Setup and Environment

(5) Web Servers



Web Server Configuration E. Wilde: Setup and Environment

(6) File Handling



Web Server Configuration E. Wilde: Setup and Environment

(7) Apache

Apache HTTP Server

Web Server Configuration E. Wilde: Setup and Environment

(8) XAMPP

XAMPP

Web Server Configuration E. Wilde: Setup and Environment

(9) Apache Configuration



HTML Basics

Outline (HTML Basics)

  1. Web Server Configuration [5]
  2. HTML Basics [11]
    1. Elements [2]
    2. Element Structures [5]
    3. Attributes [3]
HTML Basics E. Wilde: Setup and Environment

(11) Structured Documents



Elements

Outline (Elements)

  1. Web Server Configuration [5]
  2. HTML Basics [11]
    1. Elements [2]
    2. Element Structures [5]
    3. Attributes [3]
Elements E. Wilde: Setup and Environment

(13) HTML's Main Building Blocks

  • HTML pages have a header and a body
    • the header contains information about the page
    • the body contains the actual document content
  • Elements are used to mark up structures of the HTML document
    • block-level elements for paragraphs, lists, tables, …
    • inline elements for text structures (links, emphasis, …)
    • elements with specific semantics (e.g., embedding images)
  • HTML defines rules for how these elements can be combined
    • additionally, HTML defines default layouts for these elements
    • some elements also require special handling (e.g., images)


Elements E. Wilde: Setup and Environment

(14) Element Markup

  • Elements contain content for HTML structures
    • the text of a paragraph
    • the items of a list
    • the content of a list item
    • emphasized text with a list item's text
  • Elements are marked up using tags
    • start tags mark the start of an element: ul
    • end tags mark the end of an element: /ul
    • start and end tags must always match
    • elements can never overlap, everything must be properly nested


Element Structures

Outline (Element Structures)

  1. Web Server Configuration [5]
  2. HTML Basics [11]
    1. Elements [2]
    2. Element Structures [5]
    3. Attributes [3]
Element Structures E. Wilde: Setup and Environment

(16) Element Nesting

  • Elements can be nested to represent nested content
    • everything in HTML is nested (contained in body)
    • advanced Web pages often may not look like simple nested structures
    • representing a pages logical structure is important
      <ul>
       <li>Unordered lists contain one or more items</li>
       <li>Each item <em>may contain <strong>markup</strong></em></li>
       <li>items can also contain further block-level content …
        <ol>
         <li>… such as ordered lists</li>
        </ol>
       </li>
      </ul>


Element Structures E. Wilde: Setup and Environment

(17) Element Names

  • Elements may use lowercase or uppercase
    • HTML treats names as case-insensitive
    • XHTML treats names as case-sensitive
    • in XHTML, everything has to be lowercase
    • sticking to lowercase as a general rule is a good idea
      <UL>
       <LI>Unordered lists contain one or more items</LI>
       <LI>Each item <EM>may contain <STRONG>markup</STRONG></EM></LI>
       <LI>items can also contain further block-level content …
        <OL>
         <LI>… such as ordered lists</LI>
        </OL>
       </LI>
      </UL>


Element Structures E. Wilde: Setup and Environment

(18) End Tags

  • Elements can be closed explicitly or implicitly (if allowed)
      <ul>
       <li>Unordered lists contain one or more items
       <li>Each item <em>may contain <strong>markup</strong></em>
       <li>items can also contain further block-level content …
        <ol>
         <li>… such as ordered lists
        </ol>
       </li>
      </ul>
      <hr>
    <!ELEMENT LI - O (%flow;)*             -- list item -->
    <!ATTLIST LI
      %attrs;                              -- %coreattrs, %i18n, %events --
      >
    <!ELEMENT HR - O EMPTY -- horizontal rule -->
    <!ATTLIST HR
      %attrs;                              -- %coreattrs, %i18n, %events --
      >


Element Structures E. Wilde: Setup and Environment

(19) Overlapping Elements

  • HTML Elements can never overlap
    • any overlapping markup has to be interpreted somehow
    • depending on the browser, different things may happen
      <h2>Overlapping elements</h2>
      <ul>
       <li>Unordered lists contain one or more items</li>
       <li>Each item <em>may contain <strong>markup</em></strong></li>
       <li>items can also contain further block-level content …
        <ol>
         <li>… such as ordered lists</li>
        </ol>
       </li>
      </ul>


Element Structures E. Wilde: Setup and Environment

(20) Element Markup Errors

  • HTML Markup allows only certain variations
    • whitespace after the element name is allowed
    • whitespace before the element name is not allowed
    • the markup characters ( < > / ) always must be used properly
      <ul>
       < li>Unordered lists contain one or more items</ li>
       <li >Each item <em>may contain <strong>markup</strong></em></li >
       <li>items can also contain further block-level content …
        <ol
         <li>… such as ordered lists</li>
        <ol>
       </li>
      </ul>


Attributes

Outline (Attributes)

  1. Web Server Configuration [5]
  2. HTML Basics [11]
    1. Elements [2]
    2. Element Structures [5]
    3. Attributes [3]
Attributes E. Wilde: Setup and Environment

(22) Element Metadata

  • Elements may need additional information
    • usually not considered content, but data about data (thus, metadata)
  • Elements and attributes represent HTML's full capabilities
  • Some attributes can be used on many different elements
    • id can be used to assign a unique ID to an element
    • class and style are used to associate styling with elements
    • title assigns a human-readable title to an element
    • lang [http://www.w3.org/TR/html4/struct/dirlang.html#h-8.1] specifies the language of an element's content
    • on* associate various events with an element
  • Some attributes are specific to a certain element
    • href [http://www.w3.org/TR/html4/struct/links.html#adef-href] specifies the target of an a hyperlink
    • src specifies the source URI for an img
    • type [http://www.w3.org/TR/html4/interact/forms.html#adef-type-INPUT] specifies the type a form input


Attributes E. Wilde: Setup and Environment

(23) Attribute Syntax

  • Attributes are specified in an element's start tag
    • they have a name and can occur at most once per element
    • they follow a simple name=value syntax
    • values must be quoted (with some exceptions), using single or double quotes
      <h2 id="attributes">Attributes specify element metadata</h2>
      <ul type="square">
       <li>Unordered lists contain one or more items
       <li>Each item <em>may contain <strong title="'quotes' in value">markup</strong></em>
       <li>items can also contain further block-level content …
        <ol start='42'>
         <li>… such as ordered lists
        </ol>
       </li>
      </ul>
      <hr>
      <p><a href="http://validator.w3.org/check/referer">validate page</a> with the <a href="http://validator.w3.org/">W3C Validator</a></p>


Attributes E. Wilde: Setup and Environment

(24) Attribute Markup Errors

  • Attributes have to respect a number of limitations
    • they cannot be repeated on the same element
    • some attributes have restricted value spaces
    • quotes within values must be quoted with the other type of quotes
    • quotes around values must be properly paired
      <h2 id="attributes" id="error">Attributes markup syntax errors</h2>
      <ul type="diamond">
       <li>Unordered lists contain one or more items
       <li>Each item <em>may contain <strong title=''quotes' in value'>markup</strong></em>
       <li>items can also contain further block-level content …
        <ol start='42">
         <li>… such as ordered lists
        </ol>
       </li>
      </ul>


E. Wilde: Setup and Environment

(25) Summary



2009-01-26 Web Architecture and Information Management [./]
Spring 2009 — INFO 190-02 (CCN 42509)