HTML and CSS Reference
In-Depth Information
There is a special file supported by all web servers, called index.html . When users do not specify a file in the
address bar, browsers open this file by default (with content negotiation, the extension can be not only .html but
also .php , .jsp , .aspx , and so on). This is the reason why web sites can be opened without typing the file name and
extension to the end of the domain name such as www.example.com/index.html . This server behavior can also be
used for creating permanent access to web pages within a site. Instead of adding the about.html , services.html ,
portfolio.html , and contact.html files to the root directory of the domain, they can be provided as index.html
files within their own subdirectories. As a result, the pages of the site can be accessed as www.example.com/about/ ,
www.example.com/services/ , and so on, without file extensions. Naturally, original file names can also be kept if the
default file of each directory is set on the server. However, in that case, server settings should also be migrated if the
hosting provider of the web site is changed.
Namespace URIs
Namespace URIs are used to uniquely identify an XML application and separate it from other XML languages. The
prefixes associated with a namespace URI are handy when you want to associate an element or an attribute with a
particular XML namespace. Although a namespace URI does not necessarily point to a particular document, many
do, such as the http://www.w3.org/1999/xhtml namespace used by XHTML 1. x /5 (discussed earlier in Chapter 3).
The previous namespace URI will let the XML parser know that the elements and attributes used in the document are
from the XHTML vocabulary.
Some namespace uris point to the web page of the corresponding specification or standard, but many do not
and are strings only.
Note
Even if they are generally designed stable, namespaces might evolve over time [67]. To eliminate the problem,
namespaces are often registered as Persistent Uniform Resource Locators at purl.org [68]. If the resource they point to
changes, the URI can be modified in the profile settings on purl.org , which will provide the up-to-date URI with the
persistent address.
The XML namespaces are standardized according to the corresponding W3C Recommendation [69].
Summary
In this chapter, you learned about the general structure of an HTTP header, which provides information about web
documents sent by the server. You know the most common MIME types and their declaration by now, which can
be used to ensure that browsers will properly handle your web site components. You also know how to use content
negotiation on the server to eliminate file extensions, which makes future maintenance easier. Furthermore, you
learned how to serve XHTML properly, which makes all the difference, because XHTML documents served as
application/xhtml+xml will be parsed by an XML parser rather than a much less error-sensitive HTML parser. You
know how to design URIs in order to maximize their persistence.
By now you are ready to create standard-compliant markup and use the proper settings for serving the files of
your web sites. In the next chapter, you will learn techniques for separating web site content from its presentation by
using Cascading Style Sheets (CSS).
 
 
Search WWH ::




Custom Search