etsu logo

CSCI 1210

Essentials of Web Development

More HTML

Essentials of Web Design

CSCI 1210

HTML Elements

Defining document structure

HTML has a lot of elements that are defined to create documents for the web

Why do we need different elements?

Written Language

Written text, in any language, includes rules and conventions for constructing documents so that they effectively present their content

In the English language, our documents can include articles, sections, asides, headings, lists, tables, images, and so on that are used to arrange the document's information in a logical fashion that conveys meaning to the reader

We can drill down further with paragraphs, each of which consists of one or more sentences

Sentences, in turn, have their own rules, conventions, and punctuation

Relationship between structural elements

screenshot

We can use this figure to visualize how elements are nested in HTML

Inline Elements

Elements we can apply at the 'sentence level'

We call these 'sentence level' elements Inline Elements

These elements modify content within a sentence (or sentences) without breaking it up

Inline Elements - <b> / <strong>

Modifies text, making it appear bold

This is bold text
    or
This is bold text

Will display like this:

screenshot

Inline Elements - <i> / <em>

Modifies text, making it appear italic

This is italic text
    or
This is italic text

Like this:

screenshot

There are a variety of additional inline elements

<a>
<abbr>
<acronym>
<button>
<cite>
<code>
<img>
<input>
<kbd>

<label>
<q>
<script>
<select>
<span>
<sub>
<sup>
<textarea>

This isn't all of the inline elements. Just the most-often used

The Flow

We'll see, when we start with CSS, that we can modify the default appearance of each of these to suit our needs

These elements, however, provide us with a way to modify the structure of a document as well as the appearance of the display

The big takeaway here is that they are structural elements that don't break the flow of the document

When the document is rendered by a browser, it starts in the upper left corner and 'flows' across the display until it reaches its right edge

It then starts at the beginning of the next line and so on, rendering the document line-by-line

This is the document flow

Inline elements do not interrupt this

Block Elements

It stands to reason, if we have elements that don't break up the document's flow, we must also have elements that do

We call these elements Block Elements

You can think of these elements as working at the 'paragraph' (and above) level

Paragraph - <p>

The first of these we're going to talk about, appropriately enough, is the paragraph element - <p>

Just as in writing, a paragraph consists of one or more sentences

Using HTML, other elements can be included inside the paragraph element, but it usually consists of text (and inline elements) only

They 'break the flow' of the document's rendering, reset the cursor at the beginning of the next line, add whitespace, display, add more whitespace, and resume the document flow

Paragraph - <p>

This is some content

This is a paragraph

This is some other content
screenshot

Line Break - <br>

Another structural element is the Line Break

This is like a paragraph, except it doesn't add whitespace

This is some content
This is a line break
This is some other content
screenshot

Horizontal Rule - <hr>

The Horizontal Rule breaks the flow and adds a horizontal line between elements

This is some content, followed by a horizontal rule
This is more content, followed by another horizontal rule
This is some other content
screenshot

What's with the slash / ?

Sometimes, you'll see a standalone element in the code that looks like this:

    <br />
      or
    <hr />

This is an old convention that's still valid

It dates back to the old xHTML standard

Either is OK, but I prefer the elements without the slash

Headings

Headings are used to logically group related content

Similar to newspaper headlines

Very important for the user experience

By default, text is displayed bold

Headings

There are six headings: <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>

Headings range in size from <h1> (largest) to <h6> (smallest)

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
screenshot

Blockquote - <blockquote>

Sets quoted text apart indenting it left and right

Same as with print text

Blockquote - <blockquote>

This is a paragraph

This is quoted text. Usually, blockquotes are used for longer quotations

This is a paragraph

screenshot

Blockquote - <blockquote>

screenshot

Going Bigger

Thinking back on our pyramid, paragraphs (and related elements) are usually contained by larger elements

Primary among these is the <div> element

<div> is the 'workhorse' of HTML document structure

There are others - derivatives of <div> - that we'll talk about later

<div>

This is a paragraph that is contained by a <div>

Another paragraph

Divs often also contain other elements like images, figures, tables, lists, and so on

<div>

screenshot

We can see from this screenshot that the <div> element doesn't alter the display by itself

Later, we'll see how we can style it to make it display the way we want

Thinking about document structure, <div>s can be styled to perform different functions, like headers, asides, footers, and so on

Lists


Ordered
Unordered
Definition

Lists

We love our lists!

Shopping lists, to-do lists, ingredients lists, pros/cons - many data types are best presented in this format

Lists have been around in HTML since Day 1

From a design perspective, it's better to use a list, when possible, instead of a long paragraph

Remember: Users typically scan web pages for information, rather than reading start to finish

List Items

Every list consists of one or more list items

A list with one item wouldn't be much use, though, I think

The HTML element for list items is <li>...</li>

  • this is an item
  • this is another item
  • this is another item
  • this is another item
  • Types of Lists

    There are three types:

    Ordered
    Unordered
    Definition

    Ordered Lists

    1. this is another item
    2. this is another item
    3. this is another item

    The browser handles the numbering (you don't type it yourself!)

    Indented by default

    Notice that each list item is in its own <li>...</li> element

    Ordered Lists

    This is a paragraph

    1. Java
    2. JavaScript
    3. PHP

    This is a paragraph

    screen shot

    Types of Ordered Lists

    We can specify what type of numbering we want to use with an attribute - type

    1 == numbered

    A == uppercase letters

    a == lowercase letters

    I == uppercase Roman Numerals (this is a capital letter 'I')

    i == lowercase Roman Numerals

    Types of Ordered Lists

    This is a paragraph

    1. Java
    2. JavaScript
    3. PHP

    This is a paragraph

    screen shot

    Types of Ordered Lists

    This is a paragraph

    1. Java
    2. JavaScript
    3. PHP

    This is a paragraph

    screen shot

    Ordered Lists - Where to start?

    Another useful attribute is start

    Will begin the list at the current numerical value

    Types of Ordered Lists - Where to start?

    This is a paragraph

    1. Java
    2. JavaScript
    3. PHP

    This is a paragraph

    screen shot

    Unordered Lists

    Often, the order of the list items doesn't matter

    In this case, we usually use a bulleted list

    In HTML-speak, we call this an Unordered List

    These lists are defined with the <ul> ... </ul> element

    Unordered Lists

    This is a paragraph

    • Java
    • JavaScript
    • PHP

    This is a paragraph

    screen shot

    Unordered Lists

    We can specify what kind of bullet we want using the type attribute

    • disc (default)
    • circle
    • square

    Unordered Lists

    This is a paragraph

    • Java
    • JavaScript
    • PHP

    This is a paragraph

    screen shot

    Description Lists

    Description Lists are a little bit different

    Each list item has two entries

    <dt> == Data Term

    <dd> == Data Description

    Used for glossaries, etc., where list items are paired

    Description Lists

    This is a paragraph

    Java
    Programming language developed by Sun Microsystems
    JavaScript
    Programming language of the Web

    This is a paragraph

    screen shot

    Nesting Lists

    We can nest one list inside another - the 'inside' list will be contained within one of the 'outside' list's list items

    Operating Systems

    1. Linux
    2. Windows
      • Win7
      • Win8
      • Win8.1
      • Win10
    3. Macintosh
    Note about
    nesting code

    Nesting Lists

    screen shot

    Official List of HTML Elements

    http://www.w3schools.com/tags/default.asp

    The Web Design Lifecycle

    Motivation

    Successful web sites don't just happen

    A website can make - or break! - an organization

    Careful planning and design are required to create a site that meets both the clients' and users'

    Some 'best practices' have been developed over the years to help

    Remember, while we're working small this semester, the knowledge and skills you'll learn in this class are applicable to enterprise-grade websites

    Rationale

    Website design, like software design, is driven by certain realities

    A web site should be useful and usable

    A web site should meet the needs of the client

    A web site is not static

    Changes in target population

    Changes in content

    Changes in technology

    Rationale

    Any commercial project should be divided into a series of steps

    Each step involves a set of inputs and a set of expected outputs/outcomes

    This methodology

    Generates accurate customer requirements

    Provides a reasonably accurate timeline for project completion

    Helps identify necessary technology and manpower for the project

    Identifies necessary and relevant testing that the project will require

    Creates a budget for the project (kind of important)

    Stages: Analysis

    screen shot

    Input

    Initial client interview, communications & supporting documents from client; discussiong notes; online chat transcripts; (recorded) telephone conversations

    Output

    Work plan

    Cost estimate

    Team requirements

    Hardware/software requirements

    Supporting documents

    Final client approval to go ahead

    Stages: Specifications

    screen shot

    Input

    Reports from the analysis team

    Output

    Requirement specifications to

    Client

    Client representatives

    Other stakeholders

    Stages: Design & Development

    screen shot

    Input

    Requirement specification

    Output

    Site design

    Templates

    Images

    Prototype

    Stages: Content Writing

    screen shot

    Input

    Designed template

    Output

    Site w/ formatted content

    Stages: Coding & Testing

    screen shot

    Input

    Site design with forms and requirement specs

    Technical specs & documents

    Output

    Source code

    Database driven functions & documentation

    Completed application/site

    Testing records

    Error logs

    Frequent interaction with developers & designers

    Stages: SEO & Promotion

    screen shot

    Input

    Site (with unique & appealing content)

    Competitor study

    Keyword analysis

    Output

    Site submission after necessary meta tag preparation

    Stages: Maintenance

    screen shot

    Input

    Site/application

    Content/functionality update requests

    Re-analysis reports

    Output

    Updated application

    Supporting documents

    Site Mission

    Getting started right

    Every well-designed web site has

    A well-defined mission

    A set of targeted site users

    Designers cannot proceed without them

    Designers generally don't determine, but can assist

    Question client for needed information

    Often necessary to educate the client - best way to proceed and why

    If there's no mutual understanding, the project will fail or, at best, require a lot of later rework

    Site Mission Statement

    What is the owner of the site wanting the web site to accomplish? Why is it being created?

    Synthesize into a short paragraph--Site Mission Statement

    The mission statement should capture the organization's mission and how the website facilitates it

    Many companies have established company mission statements

    What we are seeking is different from that, although related

    We want to know the mission of this site not the overall company

    Site Mission Statement

    Example

    Other Examples

    SuperDog.com is the online home of the Super Dog comic character. It is a place for fun-loving people to share in the ongoing adventures of the Super Dog character, comment on events happening in the Super Dog universe, and buy Super Dog merchandise
    BuyANewHouse.com helps people wanting to buy or sell a house without a realtor, to exchange information, and negotiate a purchase

    Other Examples

    Microsoft: Our mission is to empower every person and every organization on the planet to achieve more

    Nordstrom: To give customers the most compelling shopping experience possible

    Southwest Airlines: The mission of Southwest Airlines is dedication to the highest quality of customer service delivered with a sense of warmth, friendliness, individual pride, and company spirit

    Uber: We ignite opportunity by setting the world in motion

    Google: To organize the world's information and make it universally accessible and useful

    Tesla: To accelerate the world’s transition to sustainable energy

    The Coca-Cola Company: To refresh the world in mind, body and spirit. To inspire moments of optimism and happiness through our brands and actions

    Importance of a Site Mission Statement

    Site Mission Statement defines the target we're trying to hit as designers

    Site created must fit the mission

    Designer and customer must have unified understanding of what is to be accomplished

    Protects from 'mission-creep,' also known as 'requirements creep'

    I know we agreed on this, but wouldn't it be nice if it also...

    Importance of a Site Mission Statement

    Again, we're looking at commercial website design

    As with any other serious activity, the rule is C-Y-A

    If it ain't wrote down, it didn't happen ~ Every cop, lawyer, and judge who ever lived

    Summary / Questions?

    Lecture Quiz

    Lecture Quiz

    1. What do we call <h1>Welcome!</h1>? (select all that apply)

    A. tags

    B. heading

    C. inline element

    D. block element

    Lecture Quiz

    2. Display-wise, what is the difference between <b> and <strong>?

    A. <b> is a block level element; <strong> is not

    B. <b> is an inline element; <strong> is not

    C. <b> displays text as bold <strong>, italic

    D. None

    Lecture Quiz

    3. Which block level element do we use to display long quotations?

    A. <quot>

    B. <blockquote>

    C. <q>

    D. <cite>

    Lecture Quiz

    4. Which of the following is a block element? (select all that apply)

    A. <p>

    B. <img>

    C. <a>

    D. <h2>

    Lecture Quiz

    5. What is the main element we use to group paragraphs, images, tables, etc. together?

    A. <table>

    B. <span>

    C. <div>

    D. <content>

    Lecture Quiz

    6. Which list is used when the order of its items doesn't matter?

    A. Ordered

    B. Unordered

    C. Definition

    D. Bulleted

    Lecture Quiz

    7. How do we indicate to the browser that an element is an item in a list?

    A. <i>...</i>

    B. <li>...</li>

    C. <item>...</item>

    D. <option>...</option>

    Lecture Quiz

    8. If I want my list to display a capital letter in front of each item instead of a number, what would I have to add to the opening tag?

    A. <ol type='A'>

    B. <ol start='A'>

    C. <ol bullet='A'>

    D. <ol type='a'>

    Lecture Quiz

    9. (True/False) A site mission statement is just a starting point...extra functions/features will inevitably be added as time goes on

    A. True

    B. False

    Lecture Quiz

    10. 'Design Methodology' means

    A. A website is nothing more than a couple of folks writing a bunch of code

    B. A successful website is a fairly trivial endeavor

    C. A website should be built following a defined series of steps which have proven to be successful in the past

    D. A website is formulaic and doesn't need input from clients or customers