HTML and CSS Reference
Starting from Scratch
Typically, you should perform the following core tasks when creating a web site from scratch:
Determine the document type.
index.html file. All required elements must be provided, along with the ones that
are highly recommended for structuring. 2 As a general rule, the html element should be used
as the root element for all HTML and XHTML documents. Markup documents should contain
a document head (between <head> and </head> ) and a document body (delimited by <body>
and </body> ). Beyond the general container div and paragraph p used in HTML 4.01 and
XHTML, or the more specific HTML5 structuring elements header , article , and section , the
cohesive parts of web page content should have headings. In (X)HTML, there are six levels
of headings: h1 , h2 , h3 , h4 , h5 , and h6 (from the largest to the smallest). Levels should not be
skipped (for example, applying h4 in a document in which there is no h3 but just h1 and h2 ).
Multiply files. Carefully applied copying and pasting reduces development time for hand-
coders. It provides integrity throughout the site; however, modifications should be done on all
files if the initial file has been modified. Such modifications are often easier on dynamic sites,
which typically store the identical sections centrally.
main.css ) with an initial design for basic
layout, colors, and font styles (they will be updated later). The main designing concepts
should be determined in advance.
Create the primary style sheet file (for example,
Provide optional elements. Which optional elements are reasonable depends on the project.
The various meta elements are recommended in most cases. Several link elements are also
frequently applied including, but not limited to, links to external files such as the Atom or
RSS news feed ( atom.xml , rss.xml ), the web site icon ( favicon.ico ), or optional metadata
( metadata.rdf , foaf.rdf , doac.rdf ).
Add useful extensions. The number of useful—and free—web site extensions and APIs is
Google Maps for contact details, or the Like and Tweet buttons for social networking.
Although they are popular and used by millions, most of them are not standardized. Care
must be taken to avoid invalid embedding codes provided by third-party software developers.
■ this doesn't mean you have to sacrifice third-party content, because many invalid embedding codes can be
rewritten in a standard-compliant manner.
Do additional tasks depending on client needs.
Set up hosting on a web server.
Beyond the simplest static sites, all web sites apply server-side scripting and applications with
prerequisite technology support and configuration. These depend on the user needs.
2 Development tools often provide templates and skeleton documents to begin your work with. Even text editors have options to insert
markup elements, which can be faster than typing.