Saturday, January 26, 2013

2. Web Design and Layout.


Accessing the Code Directly


As far as most designers are concerned, in a perfect world, you
could lay out a complex Web site with a visual authoring tool
and never have to see the HTML and other code, much less modify it.
Dreamweaver takes you a long way toward this goal—in fact, you
can create many types of Web pages using only Dreamweaver’s
Design view. As your pages become more complex, however, you will
probably need to tweak your code in one way or another.
Programmers, on the other hand, are happiest working directly with
the code. To accomplish their goals efficiently, coders need a responsive,
flexible editor capable of handling a wide range of computer
languages. Just how much assistance is required is a matter of personal
taste: Some code writers want all the help they can get, with
features such as syntax coloring, code completion, and Code Hints,
among others, whereas other programmers just want their editor to
stay out of their way.
Dreamweaver tries to give coders the best of both worlds by providing
a full-featured editor with numerous options. In addition to the features
mentioned in the preceding paragraph, Dreamweaver includes
full tag libraries in numerous languages: HTML, CFML, ASP.NET, JSP,
and PHP, to name a few. Both hand-coders and visual designers can
enjoy the benefits of Dreamweaver tools such as the Snippets panel,
for adding chunks of code via drag-and-drop, and the Tag Inspector,
for displaying all the attributes of a chosen tag—and making them
editable as well. This chapter covers all of these features and more.
While the Internet is made up of a plethora of technologies, HTML is
still at the heart of a Web page. This chapter gives you a basic understanding
of how HTML works and provides you with the specific
building blocks you need to begin creating Web pages. This chapter
also gives you your first look at a Dreamweaver innovation: Code
view, for altering the code side-by-side with the visual environment.
The other Dreamweaver-specific material in this chapter—which
primarily describes how Dreamweaver sets and modifies a page’s
properties—is suitable for even the most accomplished Web designers.
Armed with these fundamentals, you are ready to begin your
exploration of Web page creation.

The Structure of a Web Page


The simplest explanation of how HTML works derives from the full expansion of its acronym:
Hypertext Markup Language. Hypertext refers to one of the World Wide Web’s main properties—
the capability to jump from one page to another, no matter where the pages are located on the
Web. Markup Language means that a Web page is actually a heavily annotated text file. The basic
building blocks of HTML, such as <strong> and <p>, are known as markup elements, or tags. The
terms element and tag are used interchangeably.
An HTML page, then, is a set of instructions (the tags) suggesting to your browser how to
display the enclosed text and images. The browser knows what kind of page it is handling based
on the tag that opens the page, <html>, and the tag that closes the page, </html>. The great
majority of HTML tags come in such pairs, in which the closing tag always has a forward slash
before the keyword. Two examples of tag pairs are: <p>. . .</p> and <title>. . .</title>.
A few important tags are represented by a single element: the image tag <img>, for example.
The HTML page is divided into two primary sections: the <head> and the <body>. Information
relating to the entire document goes in the <head> section: the title, description, keywords,
and any language subroutines that may be called from within the <body>. The content of the
Web page is found in the <body> section. All the text, graphics, embedded animations, Java
applets, and other elements of the page are found between the opening <body> and the
closing </body> tags.
When you start a new document in Dreamweaver, the basic format is already laid out for you.


Listing 6-1: The HTML for a New Dreamweaver Page
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1”>
</head>
<body>
</body>
</html>
We’ll cover the opening <!DOCTYPE> tag a little later in this chapter in “Doctype and Doctype
Switching”. First you should notice how the <head>. . .</head> pair is separate from the
<body>. . .</body> pair, and that both are contained within the <html>. . .</html>
tags.
Note also that the <meta> tag has two additional elements:
http-equiv=”Content-Type”
and
content=”text/html; charset=iso-8859-1”



No comments:

Post a Comment