Chapter 14. Checklists

This final chapter contains checklists on some helpful topics. The checklists are not intended to be exhaustive and turn you into an expert on each of these topics (as there are entire books devoted to the subjects of these checklists). Rather, the purpose is to show the key points, and bring together some of the things you have learned throughout the book. There are four checklists, covering:

  • Search engine optimization

  • Accessibility

  • Differences between HTML and XHTML

  • HTML 5

Search Engine Optimization Checklist

On any successful site, a good proportion of traffic will come from search engines. In order for people to find you on a search engine, you want to be as near the top of their search results as possible.

The techniques you can use to improve your visibility in search engines are known as Search Engine Optimization or SEO for short, and can be grouped in two ways:

  • Things you can do on the site (on-page)

  • Things that appear on other people's sites (off-page)

We will mainly be focusing on the former because you have a lot more control over what appears on the pages of your own site (although mentions will be made of off-page techniques).

On-Page Techniques

Before you can start optimizing your site for search engines, you need to determine what terms users would type into a search engine in order to find your site; these are known as keywords and key phrases.

You then need to include these keywords and phrases in the copy for your site. There are four places where it is important for these words and phrases to appear:

  • Title of the page: This is specified in the <title> element, which you met in Chapter 1. It appears at the top of the browser window (above all the toolbars).

  • Description of the page: This is added using the <meta> tag, which you met in Chapter 13. While it is not visible in the page, it is often shown in the results pages of search engines.

  • Headings: You met the <h1> to <h6> tags in Chapter 1; they are used to help structure the page, providing headings that describe what will be found in the subsequent sections.

  • Body text: This is the copy that appears in the <body> of the page, for example in paragraphs, lists, and links.

It is important to remember that search engines rely on text; they cannot see what is in images (other than in the alt text that you provide on images and in filenames). Therefore, if you can incorporate the keywords and phrases that you have identified into these four parts of your pages, your site is more likely to get picked up by search engines.

You can further help the search engines by carefully structuring your documents, and using semantic markup. A good way to add structure to your pages is to organize the sections of pages using headings that describe what will be found in the following paragraphs, lists, images, and forms. Furthermore, elements such as the <address>, <cite>, <code>, and <em> elements help describe the information that will be found inside those elements.

When working with search engines, it is important to remember that you should not try to fool them (for example, do not try to squeeze extra keywords onto your page by writing them in the same color as the background of the page). Search engines know a lot of ways in which people try to fool them, and they will penalize you for this kind of behavior. You should also avoid free (or paid) tools that promise to submit your site to hundreds of search engines.

I hope that all of the preceding information seems straightforward and easy to implement. For many people, the biggest problem regarding SEO is in identifying the keywords and phrases that they should be using in the first place, and that is what we will be focusing on in this checklist.

Identifying Keywords and Phrases

When choosing keywords and phrases, it is very important to remember that in most cases, it is important to focus not just on attracting volumes of users, but also on attracting the right kind of visitors. For example, if you are creating a site for a service that is offered locally, such as slate roofing, then you probably are not interested in people who:

  • Do not live in the same geographic area you work in

  • Have a roof made of tiles or shingles

  • Live in apartment blocks (and do not have roofs of their own)

Therefore, getting 10,000 people to visit you by searching for "new roof" is not likely to be as valuable to you as getting 100 people who are looking for "slate roof Chicago."

It is also important that the page people find in the search engine has a title and description that relates to the keywords people are using when they search, because the titles and descriptions are commonly displayed in search engine results. If users do not think the page looks relevant (by looking at the information the search engine returns), they are less likely to click on the link to your page.

So, in order to come up with the search terms you are going to use on your site, use the steps in the following sections.

Brainstorm for Words People Might Search On

List every individual word you think people might search under when looking for your site.

Select Five to Ten Major Keywords

From your brainstorming list, select 5-10 major keywords, most of which will be single words (although you may have a couple of phrases, such as "slate roof").

Write these 5-10 major keywords in columns because you are going to create lists underneath them.

List Other Keywords and Phrases That Correspond to Your Major Keywords

Now that you have your list of major keywords, you can go back to your brainstorming session and expand upon the 5-10 major keywords you selected. List keywords and phrases that closely correspond to these major keywords.

You might find it helpful to look up synonyms of words in your list and also the root words of terms (for example, you might add light to a list that covers lighting).

It is also important to consider more generic terms such as buy, download, free, info, or tips, if you think that potential visitors might be hoping for one of these.

You should be looking for a total of around 20-30 popular phrases that you think your target audience will search for.

If you have a phrase that contains words such as "the" or "and," do not skip that word in the phrase. For example, "chicken and mushroom pie" should not become "chicken mushroom pie."

Look Up Related Words (Not Exact Matches)

Sometimes people will search for terms that are not exactly what your site offers, but they are close enough for your site to be relevant to that visitor. For example, thinking back to our café example, we might add restaurant and coffee shop to the lists.

If there are some terms that are not exact matches, but are relevant and related to the content of your site, add them under the major keywords.

Determine the Popularity of Terms

Use one of the following web-based tools to look up the words and phrases on your list.

  • Keyword Discovery: www.keyworddiscovery.com/

  • Wordtracker: www.wordtracker.com/

These tools both show alternative options for search terms. They also show the number of times people have searched for these words.

When you look at the alternative options for search terms on these sites, you want to look at the top 10 variations, and see how many are relevant — if several of the top 10 variations on the term apply to your site, then this should be a core term (and you should list the top 10 variations with it).

Prioritize the Core Terms

To determine the priority of the core terms that you have found, you need to look at the number of searches each core term got, and compare this number with how closely you think that search meets your target audience. At first this will require you to judge which terms you think might be most relevant to your audience, but as your site grows you will be able to use analytics software to discover how people are really finding your site.

If a search term generates 10,000 visitors, but only 10 percent would be interested in the content of your site, that term is not as valuable as a term that attracts just 5,000 viewers of whom 50 percent would be interested in your content.

Location

If the information, service or product your site offers is location-dependent, then the location should be added to your core terms.

The location you choose to include might not just be the name of the town that your business is based in. If you have customers across the state, county, or region that you work in, you might like to use those names, too (after all, more people might search on the name of the region than on your specific town).

Mapping Core Terms to Pages

Now you need to take each of the core terms (and its variations) and map them to the most relevant page.

Most of the core terms will match to internal pages. You might have more than one page focused on one core term, but you should not try to get more than one core term per page (or one core term plus location).

Homepages

The two or three most general (rather than specific) and the most popular core terms should be prime targets for the homepage.

Whenever you are looking at your on-page techniques for search engine optimization, it is important to measure the success of your efforts. This involves not only looking at things such as your page rank in Google, but also using analytics software to see which terms people are searching on most frequently in order to find your site (a topic which was introduced in Chapter 13).

Off-Page Techniques

When search engines calculate where to position your site on a list of search results, the major search engines will consider the number of sites that link to you.

The search engines are not just looking for any site that links to you, but rather for sites that contain terms similar to those that people are entering into search engines in order to find your site. For example, a search engine would not consider a link from an acupuncture site to a site about slate roofing as having the importance of a link between a building projects site and a site about slate roofing.

Search engines also look at the words that appear between the opening <a> tag and the closing </a> tag. If the text in the link contains keywords, the search engines will consider that link more relevant than one that just says something like "Click here."

If you use analytics software on your site, then you will be able to see which sites are linking to you. You can then use this information to find more sites that cover similar topics and see if they would like to cover you, too.

Accessibility Checklist

Accessibility is about ensuring that as many people as possible can access your web pages. Traditionally, writing on accessibility has focused on people who may have disabilities such as vision impairments (and therefore use screen readers to read the content of web sites to them). Others might have poor motor control and find it hard to use a mouse. However, it is increasingly becoming apparent that accessibility techniques apply to people who simply do not use a standard desktop PC to access web pages — for example, those on mobile devices who might not be able to use a mouse or view as many images at the same time.

Entire books have been written on accessible design for the Web, but this checklist will help ensure that your site meets basic accessibility requirements, and points you to the relevant part of the book where each of these topics was discussed.

Setting Up Your Document

When creating any new document, you should:

  • Use a DOCTYPE declaration to indicate which version of HTML or XHTML you are using.

  • Specify the language of your document on the <body> element. If the language changes in the middle of the text, specify it with the lang or xml:lang attributes.

Structural and Semantic Markup

In Chapter 1, you met lots of elements that are used to mark up text. You should always try to use these elements to add structure and semantic information to the words on the page. Where possible:

  • Use the different levels of headings <h1> through <h6> to organize and add structure to your pages.

  • Use elements for the purpose they were created, not just for visual effects (use CSS to control presentation of documents).

  • Use any elements available that describe the purpose or meaning of words in your page; for example, use the <acronym> element when you have an acronym on the page, use the <address> element when you have an mail address to write out, and the <code> element when you are writing code.

  • Try to use relative units of measurement for your text (rather than absolute sizes) so that users can easily increase and decrease the size of the text in their browser.

Links and Navigation

As you saw in Chapter 2, links are one of the key things that differentiate the Web from other media. Your links need to be as accessible as possible so that people can navigate your site. When you are creating links:

  • Ensure that your links stand out on the page so visitors can easily see where they should be clicking and thus can skim the page for links.

  • Use text or images inside the link that will describe what visitors will see if they click the link (do not just use terms such as "click here"). If you use images inside a link, it is important to ensure that the alt text describes what users will see if they click the link.

  • You can use the title attribute on an <a> element to provide additional information to a visitor.

  • In Chapter 5 you saw how forms can make use of keyboard shortcuts to help visitors navigate the form. Keyboard shortcuts could also be used to link to other parts of pages.

  • Avoid opening links in new windows as this can often confuse users who either do not see the new window opening, or end up with more windows open than they wanted.

  • Avoid links and interactive elements that require a user to have fine control over the mouse (or other pointing device).

Images and Multimedia

Images, audio, and video (as you saw in Chapter 3) can really bring a page to life. But assistive technologies used by those who have vision impairments are unable to describe the content of an image, audio file, or video. Therefore, there is one key rule for all kinds of multimedia content: Always provide a text description for non-text content. To achieve this:

  • Provide an alt attribute for every image, and ensure that the text you specify as a value of the alt attribute describes the content of that image to a visitor. The only exception to this rule is when the image does not convey any meaning (perhaps it is just a decorative element). In this case you still use the alt attribute, but you do not give it a value.

  • If the image is quite complex and the description does not fit nicely into the alt attribute (for example, if you have an information graphic), you can use the longdesc attribute to specify where a longer description is, or use a letter D inside a normal link that points to a longer description.

  • If you have video or audio track, provide a text-based transcript (either on the same page or link to it).

  • If you use an image map, offer a text-based alternative to the image links.

  • If you provide any animated content, ensure that there is an easy way for the visitor to pause or stop that content.

  • You should also avoid using animated content that could induce a seizure (for example, strobed content). If you do want to include such content, there should be a clear warning before that content, which the user should be forced to read and agree to.

Color

Color is an important part of any web site, but color blindness is far more prevalent than most web designers realize. When creating a page, color can help add information and organize the page. However:

  • No information on the page should be conveyed by color alone.

  • There must be sufficient contrast between backgrounds and text so that the user can read the content. (You saw tools for checking this in Chapter 13.)

Tables

We looked at creating tables in Chapter 4. When you create a table you should:

  • Use <th> elements for all headings.

  • Describe the content of the table using the <caption> element.

  • In complex tables, use the scope and headers attributes to describe which cells each heading corresponds to.

  • Not use tables as a way to control layout of entire pages.

Forms

Chapter 5 introduced forms, which you will need to use if you want to collect information from visitors to your site. I then discussed them again in the chapters that covered JavaScript. Some instructions for their use follow:

  • Use the <label> element to indicate the label for each individual type of form element.

  • If a user makes an error, where possible write the error next to the appropriate form field, and give that form element focus so the user can correct the element.

  • Make use of the <fieldset> and <legend> elements to group form controls into related functionality.

  • Access keys can help users navigate long forms.

Style Sheets

You looked at CSS in Chapters 7 and Chapter 8. Using CSS to control the presentation of a document will automatically help improve accessibility of the page (because style sheets can be overruled by a user when necessary). But you should still:

  • Use relative measurements rather than absolute measurements (or pixels) where possible (particularly for text).

  • Organize the page so it can still be read without style sheets.

  • Ensure that you have provided enough contrast in colors so that any text can easily be read.

  • Aim to design for device independence, or use CSS to provide alternative style sheets for multiple devices.

JavaScript

JavaScript was covered in Chapters 11 and 12. It is important that your pages work even if the user does not have JavaScript enabled. Here are some instructions that help ensure your scripts do not compromise the accessibility of pages:

  • If you need to use JavaScript on your pages (and they will not work without it), then you should use the <noscript> element to provide an explanation that the page will not work if the visitor does not have JavaScript enabled.

  • Do not automatically refresh pages (and if you provide this feature, allow visitors the option to turn it off).

  • Do not use JavaScript to redirect people from one page to another.

  • Ensure that your scripts can be controlled with accessible/assistive technologies (such as screen readers).

Skip Links

One topic not covered in the main part of the book is the creation of skip links. These are links that allow people who use screen readers (rather than visual browsers) to skip over the common content that appears on every page, such as the header and main navigation. Imagine that you are browsing the Web using technology that reads every single page to you; you can see that on sites where you viewed many pages, it would not take long to get tired of hearing the same header repeatedly every time you moved to a new page.

The solution to this problem is a technique generally known as skip links or skip navigation. It simply involves creating links to specific parts of the page, such as the main content, and then hiding those links from users who are browsing visually using CSS. For example, take a look at the following links after the opening body element:

<body>
  <div class="skip-links">
    <a href="#content">skip to main content</a>
    <a href="#search">skip to search</a>
    <a href="#footer">skip to footer</a>
  </div>

These links correspond to id attributes of <a> elements in the relevant sections of the page. For example, the first <h1> element might look like this:

<h1><a id="#content">Introduction to Accessibility</h1>

The links at the top of the page are hidden using a CSS rule like this so that visitors using a normal visual browser do not see the skip links:

.skip-links {display:none;}

This makes browsing a site much more pleasant for those who are having the site read to them.

Differences Between HTML and XHTML

Most of this book covers XHTML. But having learned XHTML, you are now able to code in HTML, too, because XHTML is HTML 4 written using stricter rules. The sections that follow summarize the differences between HTML and XHTML.

All Tag Names and Attribute Names Must Be Written in Lowercase

In HTML you could use a mix of uppercase and lowercase characters:

<P>Here is a <b>bold</b> word in a paragraph</P>.

In XHTML, all tag names and attribute names must be written in lowercase:

<p>Here is a <b>bold</b> word in a paragraph</p>.

All Attributes Must Have a Value Given in Double Quotation Marks

In HTML, you could have attributes that did not have a value, and the values did not need to be in quotation marks:

<form method=post>

In XHTML, all attributes must have a value (the value can just be the name of the attribute if no other is given), and they must be given in double quotation marks:

<form method="post">

Elements Must Nest; There Must Be No Overlapping

In HTML, you may find that some elements are not placed entirely within one element; the opening tag may sit inside one element and be closed outside that element:

<p>Here is a paragraph, the second half <b>will be in bold.</b></p>

In XHTML, if an opening tag sits inside another element, the closing tag must also sit within the same element:

<p>Here is a paragraph, the second half <b>will be in bold.</b></p>

Empty Elements Must Contain a Closing Slash

In HTML, you might see an empty element written like this:

<img src="images/test.gif" alt="Test image">

In XHTML, there should be a forward slash character before the closing angled bracket to indicate that the element is empty:

<img src="images/test.gif" alt="Test image" />

Scripts Should Live in a CDATA Section

In HTML, scripts and style elements could be included in a document, even if they included characters such as & or <:

<script type="text/javascript">
test(value1, value2) {
  if ((value1 < value2) && (value1.length > 5)) {
    x = true;
  }
}
</script>

In XHTML, scripts should live inside a CDATA section like so:

<script type="text/javascript">
<![CDATA[
test(value1, value2) {
  if ((value1 < value2) && (value1.length > 5)) {
    x = true;
  }
}
]]>
</script>

HTML 5

Having reached the end of a book on HTML 4.01 and XHTML, you might not expect to see an additional section showing HTML 5. But HTML 5 will be the next major version of HTML, designed to replace HTML 4.01 and XHTML.

Realistically, it is expected that the work on HTML 5 will take several years before it is finished and released; however, some browsers are already implementing some features of HTML 5 (such as new browser-side database and caching mechanisms, APIs that help add audio and video to pages or that facilitate drag-and-drop functionality, and some new elements that help add semantic information to pages).

The purpose of this section is therefore just to give you a hint of how HTML will be developing in the future.

Language Compatibility in HTML 5

In order to be backwards compatible with earlier versions of HTML, the markup of HTML 5 will not be as strict as that of XHTML.

Authors can used mixed case in tags and attributes (rather than all lowercase), closing elements may be missed, and not all attributes need to have values or be given in quotes.

There will be a new doctype declaration:

<!DOCTYPE html>

Stylistic Markup Will Be Removed

Certain deprecated elements are being removed, including <big>, <center>, <font>, <s>, <strike>, <tt>, and <u> because these effects should be achieved by CSS. Frames and their associated markup are also being removed (although the <iframe> element is likely to remain part of the specification).

Presentational attributes such as align, background, bgcolor, border, cellpadding, cellspacing, char, compact, height, marginheight, nowrap, size, type, and width are all being removed.

Having said this, in practice browsers are still likely to support these older elements so that they can render older pages, which means that these elements may still work.

New Semantic Elements

There are several new elements and attributes that reflect the typical use of modern sites. Several of these are semantic replacements for the generic <div> and <span> elements that are used to group parts of pages. Here are a few examples:

  • <nav> for a section of the page that shows navigation

  • <header> for the header of a page with introductory or navigational content

  • <footer> for footer information such as copyright and author information

  • <article> to represent an independent piece of a document such as a blog entry or newspaper article

  • <section> to act as a generic section of a document or application (it has to be a logical section; the element should not just be used to add styling to a group of elements, which remains the job of the <div> element)

  • <hgroup> to contain the header of an individual section

  • <aside> to represent something that is only slightly related to the rest of the content

  • <figure> to associate a caption with a graphic or video (for example)

    <figure>
      <video src="BobsFirstBirthday.ogv"></video>
      <legend>A video of Bob's first Birthday</legend>
    </figure>
  • <progress> to represent the completion of a task

  • <command> to represent a command a user can invoke

  • <time> to represent a date or time

To see how this new markup might be used in practice, let's look at an example of how you might create a page today using <div> elements to group together parts of the page, and then we can look at how these new elements in HTML 5 would be used to recreate the same page:

<div id="header">
  <div id="navigation"></div>
</div>
<div class="article">
  <div class="section"</div>
  <div class="section"</div>
  <div class="section"</div>
</div>
<div class="side_widget"></div>
<div id="footer"></div>

Now, if we look at how the same structure might be represented in HTML 5 you can see that the new elements add semantic information that explains what will be found in that section of the markup, rather than just grouping elements using a generic <div> element:

<header>
  <nav></nav>
</header>
<article>
  <section></section>
  <section></section>
  <section></section>
</article>
<footer></footer>

New Values for the <input> Element's type Attribute

The <input> element can take new values for the type attribute, including:

  • tel for a telephone number (a single line text box with no breaks)

  • search for a search input (a single line text box with no breaks)

  • url for a path to a page or other resource on the web

  • email for an e-mail address or list of e-mail addresses

  • datetime for a date and time (year, month, day, hour, minute, second, fraction of second, with time zone set to UTC)

  • date for a date (year, month and day with no time zone)

  • month for a date with a year and a month (no time zone)

  • week for a date consisting of a week number and year (no time zone)

  • datetime-local for a date with year, month, day, hour, minute, second, fraction of a second, with time zone

  • number for a numerical value

  • range for a numerical value with extra information that indicates a range of number (adding min and max attributes to describe the range)

  • color for a color specified using a hex code or three numbers ranging from 0 to 255

New Multimedia Elements

Other new elements provide ways to integrate specific types of content, such as the <audio> and <video> element, without relying on plug-ins. The <audio> element will allow MP3s to be embedded into the page; the <video> element is more controversial at the time of this writing, as browser manufacturers are struggling to agree on one common format that all browsers will support.

HTML 5 will also be able to use SVG and MathML inline.

New APIs

In addition to the Document Object Model (which you learned about in Chapter 11, which introduced JavaScript), new interfaces are being developed that cover the following:

  • Offline storage of data: Allows the browser to store information locally; this is already being used for things such as managing e-mail when you are not connected.

  • Geolocation: Allows the browser to identify where you are, which then enables featuers such as searches to be localized.

  • Canvas: Allows you to create two-dimensional drawings using JavaScript, which could have many applications from creating graphs and information graphics to producing interactive animations.

  • Timed media playback: Allows the browser to access and play time-based media such as audio and video, as well as showing the states of the files (such as whether they are ready to play or not, and whether they are loading).

  • Drag and drop: Provides an event-based system for dragging and dropping elements of a page.

  • Cross-document messaging: Allows part of a page to communicate with another part of the page or even a different window, without the entire page being refreshed. For example, you might have a text editor for creating a new blog post in one part of the page and a live preview of what that page will look like in another (where updates are shown in real time, without needing to refresh the page).

All the information in this section is still subject to change over the next few years until those working on the HTML 5 specification have finished it. Once the specification has become final, it is likely that many visitors to sites you develop will still be using older browsers, so you may not be able to use these new features for another few years. Having said this, many browsers are starting to implement some of the features discussed in this section, and you should be able to experiment with them over the next few years as they develop.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.227.251