First in a series of workshops for graduate students in the Department of English at UC Santa Barbara.
More information: http://patrickbrianmooney.nfshost.com/~patrick/ta/lead-ta/web-design/2013-2014/
YouTube screencast with audio: http://youtu.be/7Sv0LLGgi9A
Web Design for Literary Theorists I: Introduction to HTML
1. Introduction to Web Design
For Literary Theorists
First Workshop:
An Introduction to (X)HTML
11 April 2014
Patrick Mooney
Co-Lead TA, 2013-2015
Department of English
UC Santa Barbara
2. Objectives for this workshop series
â To learn the basic skills involved in building a
small website for a course or section.
â To actually build such a web site, and to do a
good job of it.
â To engage in practices that minimize the labor
required to do so.
â To make your teaching practices more visible
on the web.
â To be able to read various versions of HTML in
other places on the web.
3. Objectives for todayâs workshop
â To learn the basics of HTML, the standard
markup language for web content.
â To understand the assumptions that HTML
makes about your content, and to leverage
those assumptions to produce a web site that
is attractive and easily âparsedâ by a viewer.
â To engage in practices that will allow you to
participate effectively in the later workshops in
this series.
â To begin actually constructing a static section
website.
4. Details, details ...
â Iâm going to be moving over a lot of details
rather quickly today.
â You donât need to memorize them all.
â There are great references on the web, of course.
â This presentation will be online in a few days.
â Whatâs important is that you pick up major concepts
and work along with them.
â Come talk to me in my Lead TA office hours if you
have questions!
â A collection of useful links is online at
http://is.gd/todoho.
5. Why have a course/section website?
â Section websites give your students a central place to
look for information.
â Handouts.
â Notes and announcements.
â Policy documents.
â Helps to make your teaching practices easily visible on
the web.
â Helps to establish an identity for you on the web.
â Helps to link your teaching practices to your online identity.
â One of our recurring concerns throughout this series of
workshops will be increasing the visibility of your web
presence.
6. Why not just use some other service?
â Any choice you make for web presence
management has some downsides. As with
everything in life, no solution is ever perfect.
â Here are some downsides to building a web site
by hand with HTML:
â You have to learn HTML. (Not hard, especially for
literary theorists.)
â You have to see your content in a non-word-
processing based way. (i.e., you have to think
primarily about content and structure rather than
presentation.)
â You have to find someone to host the content. (Not
difficult, nor necessarily expensive.)
7. Why not GauchoSpace?
â GauchoSpace imposes its own structure and
presentation on your content.
â In my personal opinion, GauchoSpaceâs layout is
horrible.
â Many of you have interacted with students who have a
hard time finding information on GauchoSpace. This is
partly because GauchoSpaceâs design is poorly thought
out and does not leverage existing web-based
information-seeking practices.
â GauchoSpace is access-controlled.
â Your teaching practices are only visible to people
enrolled in the course, and only while they are enrolled
in the course.
8. Why not some free blogging service?
â Free blogging services tie your content to a
particular provider.
â You canât easily move your website from, say,
Tumblr to WordPress without re-doing a lot of
work.
â All free blogging services restrict what you can
actually do with your HTML code.
â This is a bad thing for reasons I wonât fully explain
until later in the quarter.
â Blogging services impose their own
information ontology onto your content.
9. Why build a web site with HTML + CSS?
â Itâs not that hard.
â You gain full control over how your text is
presented.
â You gain full control over how your text is
organized and ontologized.
â You can easily move your content elsewhere with
a minimum of work if your content provider âŠ
â goes out of business
â cancels the service you use
â stops providing adequate service.
10. What you wonât learn in these
workshops
â Everything about every version of HTML.
â Everything about producing cutting-edge designs.
â How to produce web sites with active content.
â More than a little bit about search-engine optimization.
WHICH IS TO SAY âŠ
â Some of the information youâll get here is partial or
moderately simplified (but itâs honest and, I think, sufficient).
â Youâre not going to walk out of here with the skills to be a
professional web designer.
â However, you will walk out of here knowing enough to
present your content to your students â and the world â in a
way that reflects positively on you.
11. How the Web Works: Quick
Refresher
â You type an address (URL) into your browserâs
address bar.
â Your browser interprets the address to discover
which server (another computer on the Internet)
holds the requested document (âweb pageâ).
â The document is fetched from that server.
â Any supporting documents are also fetched and
interpreted.
â Your browser interprets and displays (ârendersâ) the
document in a way that is compliant with standards.
â The user then (hopefully) reads and/or otherwise
12. â Your web site will consist
of multiple HTML files and
any other supporting
documents.
â Any images (videos, audio,
other media) that are
needed for your web site
are not part of the HTML
file itself, but separate
documents.
13. So, HTML ...
â stands for âHypertext Markup Language.â
â is the standard way of describing the structure of textual
documents on the web.
â HTML is not a âprogramming language.â There are no
commands. There are no variables. It just describes the structure
of a text.
â does not give you complete control over every tiny aspect
of how a document appears in the userâs browser.
â can be read and understood by every piece of software
that deals with textual documents on the web.
â Is a standard administered and maintained by the World
Wide Web Consortium (W3C).
14. Some HTML coding examples
â HTML consists of text marked up with tags
that indicate the structure of the text that is
being marked up.
â There are several dozen legitimate tags (many
of which you will never use). Each begins with
< (the less-than sign) and ends with > (the
greater-than sign).
â Tags can have attributes (characteristics).
Certain attributes for certain tags are
mandatory.
<img src="kitten.jpg" width="200" height="100">
15. Tags in your document
â Each tag that you open must be closed before
the end of the document.
â Technically, tags should be closed in the
reverse order in which they were opened.
Correct:
<i><b>Example</b></i>
Incorrect:
<i><b>Example</i></b>
â Some tags (those that are not containers for
textual content) can be self-closed:
<img src="kitten.jpg" width="200" height="100" />
16. A quick reminder
â The texts that you work with are already âmarked upâ in
various ways
â paragraphs, pagination, chapter divisions, emphasis,
punctuation â are all (in a sense) paratextual elements that
give you hermeneutic clues.
â All youâre doing with your HTML markup is making (a
certain set of) hermeneutic clues explicit.
âEvery page, even a blank page, even a page of George W.
Bushâs ignorant and vapid prose, is n-dimensional.â
â Jerome McGann, Radiant Textuality: Literature After the World Wide Web (p.
184; ch. 6)
17. A minimally acceptable XHTML
document
â The <!DOCTYPE> declaration is (to you) a string of gibberish whose purpose is to
tell the browser what flavor of HTML youâre using.
â The xmlns= attribute on the <html> tag tells XML parsers how to parse the HTML.
â You can just look up these values, or (even better) use existing documents as
templates.
18. Some Useful Block-Level Tags
<blockquote></blockquote> â you know what
this does, right?
<h1></h1> â marks a top-level heading
<h2></h2> â marks a subheading
<h6></h6> â marks a sub-sub-sub-sub-
subheading
<p></p> â marks up paragraphs
<ul></ul> â unordered lists (bullet points)
<ol></ol> â ordered lists (numbers, letters)
<li></li> â a list item
19. Some Useful Inline Tags
<abbr title="Modern Language
Association">MLA</abbr> â an abbreviation
<br /> â a line break.
<cite></cite> â marks a citation.
<code></code> â marks up computer code.
<em></em> â marks text that is emphasized.
<img src="a URL" alt="some text" /> â embeds an
image.
<strong></strong> â marks text that is very strongly
emphasized.
<q></q> â marks a quotation.
20. The <img> tag
<img src="fakebeard.jpg" width="480" height="640"
alt="a man with a fake beard" />
<img src="http://i.imgur.com/HndKeBY.jpg" width="480"
height="640" alt="a man with a fake beard" />
â The src attribute is the location (URL) of the image itself.
â The width and height attributes (measured in pixels) are
hints to help the browser render the page without having to
wait for the image to download.
â The (mandatory) alt attribute tells browsers for visually
impaired users what to say instead of displaying the picture.
â Note that, because itâs not a container for text, the <img>
tag is self-closed.
21. Some image considerations
â The fewer images you use, the more quickly your
web page will render, because each image has to
be fetched separately.
â You can ameliorate the rendering delay by using the
width and height attributes.
â Using a bunch of spurious damn images just
because you feel like using a bunch of spurious
damn images is often considered to be
unprofessional, or at least poor design.
â Keep the focus on what matters.
â Use the alt attribute to provide cues for visually
impaired users.
22. Some image considerations
â Image file sizes will often be much larger than
the size of the HTML document that refers to
them. Hosting them elsewhere than on your
own server can save you money.
â However, if youâre using images that are hosted on
a site other than your own, make very sure that
thatâs OK with the site from which youâre linking
them.
â A rule of thumb: use the JPEG format for
photographs, and PNG for line-drawings and
other non-photographic images.
23. The <a> tag
â Creates links:
<p><a href="http://gauchospace.ucsb.edu">GauchoSpace login
page</a></p>
â Creates anchor points inside a document to which you can
link:
<a name="no-very-late-papers" />
<h2><a name="no-very-late-papers">Late paper policy</a></h2>
â A link to an anchor point:
<p>Details are spelled out in my <a
href="http://patrickbrianmooney.nfshost.com/~patrick/ta/s14/eng13
3so/section-guidelines.html#no-very-late-papers">late paper
policy</a>.</p>
24. Different ways to specify URLs
â You can always specify a full URL any time a
URL is required (with <a>, <img>, etc.).
<a
href="http://gauchospace.ucsb.edu">GauchoSpac
e login page</a>
<img src="http://i.imgur.com/HndKeBY.jpg"
width="480" height="640" alt="a man with a fake
beard" />
â However, this is cumbersome if you have to do
it all the time, so there are also ways to specify
URLs relative to the URL of the document
doing the specifying.
25. Partially specified URLs
There are several possibilities, each relative to the
URL of the document containing the partial URL.
If the base URL of a document is, say,
http://patrickbrianmooney.nfshost.com/~patrick/ta/index.html âŠ
â Not specifying any folders:
<img src="bulletpoint.png" /> means âthe file
âbulletpoint.pngâ in the same folder as the document
referring to itâ:
http://patrickbrianmooney.nfshost.com/~patrick/ta/bulletpoint.png
26. If the base URL of a document is, say,
http://patrickbrianmooney.nfshost.com/~patrick/ta/index.html âŠ
â In a sub-folder of the current folder:
<a href="s14/eng133so/index.html"> means âthe file
âindex.htmlâ in the folder âeng133so,â which is in the
folder âs14,â which is in the current folderâ:
http://patrickbrianmooney.nfshost.com/~patrick/ta/s14/
eng133so/index.html
â Note that the URL does not begin with a
slash
â In the folder above the current folder:
<a href="../personal.html"> means âthe file
âpersonal.htmlâ in the folder above the current folderâ:
http://patrickbrianmooney.nfshost.com/~patrick/personal.html
27. If the base URL of a document is, say,
http://patrickbrianmooney.nfshost.com/~patrick/ta/index.html âŠ
â Full path from the root (top-level) folder:
<a href="/~patrick/personal.html"> means âthe file
âpersonal.htmlâ in the folder â~patrick,â which is in the
top-level folderâ:
http://patrickbrianmooney.nfshost.com/~patrick/personal.html
â Note that the URL does begin with a slash
â The fact that you can refer to other documents in
these ways is a good reason to have a sensible
file system layout that you can remember.
28. Tables for presenting information
Begins the table
Table heading
A table row
A table row
Ends the table
<table>
<tr><th>Name</th><th>Grade</th></tr>
<tr><td>John Smith</td><td>B+</td></tr>
<tr><td>Ana Garcia</td><td>A-</td></tr>
</table>
â A table consists of individual rows (and should have a header);
each row contains individual table data âcellsâ (<td></td>).
â In the 90s, it was common to enclose entire documents in a
table to control document layout. Donât do this. Tables have a
semantic meaning. Also, this interferes with screen readers.
30. Tags youâll see, but shouldnât use
<b></b> â bold text
<big></big>, <small></small> â to change text size
<blink></blink> â is primarily used to ensure that
people hate you.
<center></center> â for centering text
<font></font> â for font size and face
<i></i> â italic text
<sub></sub>, <sup></sup> â subscript, superscript.
<u></u> â underlined text
31. Good Semantic XHTML Practices
(some are mandatory)
â Follows semantic rules and is formally valid.
â Tags and attributes are entirely in lowercase.
â Every tag is either self-closed or closed after
the end of its content occurs.
â Reminder: tags are closed in the reverse order in
which they were opened.
â Attribute values are enclosed in quotation
marks.
â Code is easily readable by you so that
changes are not painful to make.
32. â Because the rendering of HTML collapses
whitespace (spaces, tabs, carriage returns), you
can put in as many spaces (tabs, carriage
returns) as you want to make your meaning and
structure clear to yourself â without affecting
how your document looks when the userâs
browser renders it.
â Describes the structure of the text, rather than
attempting to control appearance.
â To put it another way, you should separate
appearance from content.
â Weâll talk in detail about controlling appearance at
our next workshop.
33. Attributes for any tag
â <tag id="something">
â Attaches a unique ID to an individual tag for some
purpose of your own.
â <tag class="something something_else">
â Indicates that the tag belongs to one or more
groups that you yourself designate for some
purpose of your own.
â <tag style="some valid styling information">
â This is a poor overall strategy for styling your text,
for reasons weâll talk about at our next meeting,
but not a bad way to see quickly how things look.
34. Tags that do nothing (thatâs visible)
â <span></span> â marks an inline group of text
for some purpose of your own.
<p>I thought that <span class="book-title">1Q84</span>
was a very disappointing novel.</p>
â <div></div> â marks a block-level group of text
for some purposes of your own.
<div class="document-header">
<p>I was very disappointed by <cite>1Q84</cite>.</p>
<p>However, I quite enjoyed <cite>Infinite
Jest</cite>.</p>
</div>
â Weâll talk about these extensively next time.
35. A few words about validity &
standards compliance
â You can get away with writing bad HTML, and it
may look OK when rendered. However:
â Invalid HTML renders differently in different browsers.
Itâs also very hard for machines to parse in other ways.
â HTML that is presentational rather than semantic
involves vastly more effort to maintain.
â Presentational, non-semantic HTML limits your ability
to make your web pages intelligible to machines
instead of people.
â Google search
â Screen readers for the visually impaired
â Other web applications âŠ
36. Making sure it works
â Write good HTML in the first place.
â Make it intelligible to you.
â Semantic, not presentational.
â Use a text editor that helps you to check validity
with features like syntax highlighting.
â Check formal validity with the W3Câs validator.
â You can also use it to clean up your code.
â Test on at least two different browsers.
â Ideally, you should also test it on several devices:
â Your phone, different operating systems, etc.
37. Intro to web information ontology
â Donât try to put everything on one page. Break
information into multiple documents, each of
which is âŠ
â More or less complete in itself.
â Linked to other, related documents.
â And linked back to your home page.
â Use good journalistic writing practices.
â Most important information first in any document.
â Crucial information is âabove the fold.â
â Your semantic markup helps to show the structure
of your document to the viewer.
38. â Organize your files in a series of folders that
makes sense to you and provides an
epistemological indication in the folder path of
how the information is categorized.
â Remember that your folder path will become part
of the URL when you upload your site.
â Make each subfolder increasingly specific in some
sense.
â Include an index.html file in each folder.
â Generally, a good practice here is to make each
index.html file a menu that provides an overview of
whatâs in that folder, or in the subfolders it
contains.
39. A suggestion âŠ
â You wonât really have learned anything today
unless you apply these skills in the near future.
â Take your existing section guidelines handout and
produce an HTML version.
â Start setting up a section website. You can take one
of mine as a model, if youâd like.
â Produce HTML versions of any other documents that
you have the time and inclination to produce.
â Run them through the W3Câs validator and resolve
any problems.
â Come talk to me in my office hours if you hit any
snags!
40. Building a minimalist personal web site
â You should have a main page with a blurb about who
you are, plus links to major other information on the
site. (Having some color on it somewhere is often
thought to be a good idea.)
â Good pages to have might include:
â Web collections youâve built for students.
â Your CV.
â Links to you on other places on the web.
â Linking back to your web page from your LinkedIn, Facebook,
academia.edu, Twitter, Flickr, Google+, and other profiles is a
smart move.
â A âpersonal infoâ page (if done thoughtfully and tastefully).
41. Where weâre going next
(or, letâs talk about scheduling)
â Our second workshop will introduce CSS, or Cascading
Style Sheets.
â This will serve as an introduction to how you control the
presentation of semantically encoded HTML.
â We will also talk about hosting your content once you have
some content to host.
â Week 5? Week 6?
â Our third workshop will present some additional, related
topics:
â Making your content meaningful to search engines and other
text-parsing software.
â Preventing search engines from indexing your content.
â Google Scholarâs article-inclusion guidelines.
â Week 9? Week 10?