Basic Training Course
Basic Training Course
HTML
1. Introduction ................................................................................................................................................. 4
What is HTML? ................................................................................................................................................ 4
What are the Uses of HTML? .......................................................................................................................... 4
Document Structure ........................................................................................................................................ 4
Getting Started ................................................................................................................................................ 5
Writing the HTML Document ........................................................................................................................... 5
HTML Tags ...................................................................................................................................................... 6
Some Attributes of the Body Tag ..................................................................................................................... 6
2. Formatting ................................................................................................................................................... 8
Heading Tags .................................................................................................................................................. 8
Paragraph Tag ............................................................................................................................................... 8
Line Break ..................................................................................................................................................... 8
Horizontal Rule Tag ........................................................................................................................................ 9
Font Style Tag ................................................................................................................................................ 9
Phrase Tags ................................................................................................................................................... 10
Preformatted Text Tag .................................................................................................................................... 10
Lists ................................................................................................................................................................ 11
4. Links ............................................................................................................................................................... 14
URL (Uniform Resource Locators) ................................................................................................................. 14
Linking ............................................................................................................................................................ 15
5. Images ........................................................................................................................................................... 16
Image Tag ...................................................................................................................................................... 16
Map Tag ......................................................................................................................................................... 17
1
6. Forms .......................................................................................................................................................... 20
Form Tag ....................................................................................................................................................... 20
Input Tag ...................................................................................................................................................... 20
Option Tag ................................................................................................................................................... 23
Select Tag ..................................................................................................................................................... 23
Optgroup Tag ................................................................................................................................................ 24
Label Tag ...................................................................................................................................................... 25
Textarea Tag ................................................................................................................................................. 25
7. Tables ........................................................................................................................................................... 28
Table Tag ...................................................................................................................................................... 28
TR Tag ......................................................................................................................................................... 29
TD Tag ......................................................................................................................................................... 30
8. Frames ........................................................................................................................................................ 31
Frame Tag .................................................................................................................................................... 31
NoFrames Tag ............................................................................................................................................ 33
IFrame Tag .................................................................................................................................................. 33
2
2. All CSS Properties.................................................................................................................................. 40
Background Properties .................................................................................................................................. 40
Border Properties ........................................................................................................................................... 42
Classification and Positioning Properties ....................................................................................................... 47
Dimension Properties ..................................................................................................................................... 49
Font Properties ............................................................................................................................................... 50
Generated Content Properties ........................................................................................................................ 52
List Properties ................................................................................................................................................. 53
Margin Properties ........................................................................................................................................... 54
Outline Properties ........................................................................................................................................... 55
Padding Properties ......................................................................................................................................... 56
Page Properties .............................................................................................................................................. 57
Table Properties .............................................................................................................................................. 58
Text Properties ................................................................................................................................................ 59
Other Properties ............................................................................................................................................. 62
Dreamweaver
1. Introduction ............................................................................................................................................... 66
3
HTML
1. Introduction
What is HTML?
Hypertext
Hypertext is a word or phrase which acts as a link to another document or file. When that word is
typed, one can jump from one file to another. It is just like jumping from one page in a book to
another.
Markup Language
Markup Language enables the styling or designing of the text in the line. Applying some specific
codes to it can do the styling of the text or a line. It is done to make the text look attractive.
These codes are known as"Markups"and a collection of them is a"Markup Language".
Document Structure
HTML documents are structured into various tags. Every document has four tags (Basic Tags).
These tags are:
HTML
<HTML> tag is put at the beginning and end of any document. Everything in the document
goes inside the <HTML> tag.
4
HEAD
The <HEAD> tag contains general information about the document. It lies just below the <HTML>
tag. It is like the cover page of a document containing general information about it.
TITLE
The title of a document is specified by the <TITLE> tag. It is placed between the <HEAD> tags.
Each document can have only one title.
BODY
The <BODY> tag contains the contents of the document. All the text, headers, tables, headings,
paragraph, etc go into this tag.
Getting Started
A basic HTML document is written with the four tags given above.
(Note: All HTML Documents require the minimum “tagging” in order to function in your Browser. )
An HTML file is saved with the extension ‘.html'; for example “mypage.html”.
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
This is my first web page
</body>
</html>
5
HTML Tags
As discussed above, tags are the elements that make up the HTML document. The following points
elaborate their use and grammar:
• Tags are used to denote the various elements in an HTML document.
• A tag consists of a left angle bracket (<), a tag name, and a right angle bracket (>).
• All tags are paired, meaning that a tag started has to end.
• The start tag looks like <BODY>. The end tag is preceded by a slash (/), e.g. </BODY>.
• Some tag elements may include an attribute, which is additional information included
inside the tag.
• These attributes can be anything like the alignment of images, font size of the text, etc.
• HTML is not case sensitive. This means that the tag <TITLE> is equivalent to <title>.
BGCOLOR
This attribute sets the background color of the web page. For example, to set the background
color of the web page to blue, one has to type <BODY BGCOLOR = “BLUE”>
BACKGROUND
This attribute sets the picture to be used as a background for the page. If the picture is stored in
the same directory as that of HTML document, then only the name of the picture has to be typed.
In the other case, the full path of the picture has to be typed. For e.g.
TEXT
This attribute sets the color of the text on the page. To set the color of the text to blue, the syntax
is:
TOPMARGIN
This attribute sets the size of the top and bottom margins. It accepts an integer value. To set the
top and bottom margins to 1, the syntax is:
6
LEFTMARGIN
This attribute sets the size of the left and right margins. It accepts an integer value. To set the left
and right margin to 1, the syntax is:
COMMENTS
There can be notes left for viewing in an HTML document. These notes are not visible in the web
browser. To do this the Comment tag is used. The comment tag is a single tag, which means that
this tag does not end. The comment is started with an exclamation mark. Exclamation mark is put
after the opening bracket but not before the closing bracket.
<html>
<head>
</head>
</body>
</html>
7
2. Formatting
Formatting is the structuring and styling of the document. Formatting allows the designer to
determine the appearance and create the style of the HTML document.
As discussed in the earlier chapter, formatting is done with the help of tags. These tags help in
making the HTML document readable and interesting. This chapter illustrates tags in detail.
Heading Tags
Headings are created in HTML by adding text between the <h1> tags; also known as the heading
tags. The heading tag is used to separate the paragraph of the text from the heading.
HTML has six levels of headings, numbered 1 through 6 in decreasing order. In other words; 1 is
the biggest heading, 6 is the smallest. For e.g. <h1>,<h2>,<h3>,<h4>,<h5> and <h6>.
Headings are displayed in larger and bolder fonts than normal body text. The most important
heading should be between the <h1> tags. This is illustrated with the help of an example:
Paragraph Tag
The paragraph tag indicates the start of a new paragraph. It is defined by a <p>. When some text
is put within the <p> tags, it is displayed in a new paragraph. A single line above and below the
paragraph is automatically left blank.
Example:
<p> A new paragraph is started with the text written within these tags. </p>
Example:
<p align=center> A new paragraph is started with the text written within these tags. </p>
Line Break
A line can be ended after a certain word without starting a new paragraph. This can be done by a
<br> tag. It just inserts a single line break.
8
Example:
<p> A new paragraph is started with the text written within these tags. <br/> This text will come in the next
line. </p>
Example:
<p>This line lies above the horizontal rule. <hr/>This line lies below the horizontal rule.<p>
Bold
The bold tag is written as <b>. The text written between these pair of tags is shown as bold in the
document.
Italics
The italics tag is written as <i>. The text written between these pair of tags is shown in italics in
the document.
Big
The big tag is written as <big>. The text written in these pair of tags appears bigger than the
normal text.
Example: <p><big> This text will appear big </big></p>
Small
The small tag is written as <small>. The text written in these pair of tags appears smaller than
the normal text.
Example:
< html>
< head>
< title> My bag of jokes </ title>
</ head>
< body background = "myimage.jpg" text = “blue”>
9
<!----I am starting off with my web site---->
< h1 align= left> I want to make you laugh</ h1>
</body>
</html>
Phrase Tags
The following tags are all phrase element tags. These tags help in providing a richer effect to the
web page.
Emphasized Tag
The emphasized tag is written as <em>. This is used to emphasize or stress on a text. The
emphasized text in the output is usually in italics.
Code Tag
The code tag is written as <code>. It indicates that the text written is an example of a typed
code. It is usually in a fixed font.
Strong Tag
The strong tag is written as <strong>. This tag helps to emphasize or highlight the text. The text
appears in bold.
10
Lists
Lists are the next element of an HTML document. Lists are an often–used constituent in a web page.
A great way of laying out information is through lists. Lists are simple to read and easy to look at.
They make the web page look attractive and readable. The user can understand and retain more if
the information is presented to him in a list.
Note: The example of list index tag is shown with the example of unordered and ordered lists.
Unordered Lists
An unordered list is defined by the tag <ul>. It is a list of items in which the items are preceded
by bullets or by markers.
Example:
<ul>
<li>Classic jokes </li>
<li>Math jokes </li>
<li>Food jokes</li>
</ul>
Ordered Lists
An ordered list is defined by <ol>. An ordered list is quite similar to unordered list. The only
difference is that numbers precedes the list items of ordered list. The first list item gets the
number “1” and so on.
Example:
<ol>
<li>Crazy jokes</li>
<li>Ethnic jokes</li>
<li>Golf jokes</li>
</ol>
11
<em> Defines emphasized text
The following example illustrates how lists are used in the web page:
Example:
< html>
< head>
< title> My list of jokes </ title>
</ head>
< ul>
< li>Classic jokes </ li>
< li>Math jokes </ li>
< li>Food jokes</ li>
</ ul>
< hr />
< ol>
< li>Crazy jokes</ li>
< li>Ethnic jokes</ li>
< li>Golf jokes</ li>
</ ol>
</body>
</html>
12
3. Character Entities
Some characters have a special meaning in HTML, like the less than sign (<) that defines the start of an HTML tag. If we
want the browser to actually display these characters we must insert character entities in the HTML source.
A character entity has three parts: an ampersand (&), an entity name or a # and an entity number, and finally a semicolon
(;).
To display a less than sign in an HTML document we must write: < or <
The advantage of using a name instead of a number is that a name is easier to remember. The disadvantage is that not all
browsers support the newest entity names, while the support for entity numbers is very good in almost all browsers.
Non-breaking Space
The most common character entity in HTML is the non-breaking space.
Normally HTML will truncate spaces in your text. If you write 10 spaces in your text HTML will remove 9 of them. To add
spaces to your text, use the character entity.
13
4. Links
The contents of this chapter relate to the concept of linking of HTML documents. It answers the
queries related to the definition of linking, the method of linking HTML documents, and how
images are put on the web page.
Before going on to links in detail, some preliminary concepts have to be understood. These
concepts will help one in linking HTML documents in a better manner.
URL
The acronym URL stands for Uniform Resource Locator. This is an address that specifies the
location of files on the Internet. In other words; the World Wide Web uses URLs to specify the
location of files on other servers. A URL includes the type of resource being accessed, the address
of the server, and the location of the file. The syntax is:
Example: http://host.domain/path/filename
Relative Pathnames
Documents can be linked to other directories by specifying the relative paths to the linked
document. For e.g. A link to a file mycode.html located in the subdirectory codes would be:
These are called relative links because the path to the linked file, relative to the location of the current file is specified.
Case 1
If the file to be accessed is stored on a lower level of directory than the current directory, then
that file can be accessed by simply typing the directory name/ filename in the href attribute.
Note: The use of the term ‘href’ is explained in detail in the following pages
In the following example, the file ‘work’ is a subdirectory of the current directory and the file
myfile.html is stored in ‘work’.
Case2
If the file to be accessed is stored on a higher level of directory than the current directory, that file
can be accessed by simply typing ../ before the name of the file. Each ../ tells the web browser to
go one level up relative to the current directory.
In the following example, the browser has to go two levels up to link the file to the document.
14
Absolute Path
Absolute path is used to link those documents that are not directly related to the current
document. Links to some other website should be absolute as they are not related to the current
directory. In this way even if the current directory is moved, it will not affect the links.
Linking
The real power of HTML comes from the fact that different documents can be linked together. With
the help of this tool, a text or an image can be linked to any part of the document or section of a
document. A browser highlights the identified text or image with color or underlines to indicate
that it is a hyperlink.
Anchor Tag
The <a> tags indicate the anchor tag. An anchor is a piece of text or some other object (like
image) to mark the beginning and/or end of a hypertext link. An anchor tag by itself doesn’t do
anything; it creates a link to another document by using the “href” attribute. The following are
some attributes of Anchor tag:
Href
Href stands for Hypertext Reference. The address of the file or the address of the website is given
in the ‘href’ tag. The address is the name of that document which the web page links to.
Target
Target is another attribute of anchor tag. It specifies where the target URL should open. It takes
up various values, which are:
_blank
The target file will open in a new window.
15
5. Images
The previous sections were confined to the design of web pages/HTML documents that contain
only textual content. This section elucidates the technique of inserting images in the web page,
making the web page more pleasing to the eye. It goes a step further in assisting the user to
personalize the HTML document.
HTML enables authors to display images in a document. Images make the web page look good.
When a picture compliments the text on the web page, it generates more enthusiasm in the user.
Image Tag
The image tag is written as <img>. This is used to display an image in an HTML document. The
image tag is a singular tag, which means it need not be closed as </img>. But, the latest version
of HTML does not support this. In the latest version, the image tag is to be closed by putting a (/)
backslash, e.g. <img/>.
The Image tag is similar to the anchor tag as discussed earlier, in the sense that the image tag
alone does not perform any function. It has to include various attributes so that the image can be
displayed on the page.
Src
Src is the source attribute. It indicates the location or the path of the picture to be displayed on
the web page.
Alt
lt is an attribute, which displays an alternative text if the picture is not displayed on the web
browser.
Width
The width attribute determines how wide the picture is to appear on the web page.
Height
The height attribute determines the height of the picture that has to appear on the web page.
16
Align
The align attribute sets the alignment or the position of the picture in relation to the text around
it.
Border
The border attribute sets a border around the images. A border value greater than 0 puts a border
around the image.
Example:
<html>
<head>
</head>
<body background ="myimage.jpg" text = “blue”>
</ul> <hr/>
</body>
</html>
Map Tag
A map tag is used to map an image. In other words; this image, called the mapped image,
contains some regions that act as links to other documents. It is written as <map>. The user can
set these regions and these regions are quite similar to a hyperlink. This is because when they are
clicked on, they refer to some other document.
To create an image map, another tag called area tag is used which will be explained later.
17
Attribute of Map Tag
Name
The name attribute sets the name of the image map. It determines which map definition the
image uses.
Area Tag
The area tag defines a region in an image map. This tag includes various attributes as it cannot
function alone. It requires the href attribute to link to other documents.
Attributes of Area
Href
The href tag indicates the URL that the <area> tags links to. The syntax of this tag is similar to
the anchor tag.
Alt
The alt attribute in the <area> tags works just like it works in the <img> tags. It indicates the
alternative text that is to be displayed if the browser does not display the picture.
Cords
The cords attribute is the coordinate attribute. This tag is used with the shape attribute (the shape
attribute has been described later).
It specifies the coordinates of the area that has to be clicked and indicates where the shape is
located in the image map. The Cords tag is necessary when the shape attribute is set to Rect,
Circle or Poly. It is not required if the shape is set to Default.
Shape
The shape attributes indicate what shape the area is. The shape of the map must be set to the
following values:
18
Rect
Rectangular shape indicates that the area is a rectangle. The cords attribute consists of two pair of
x/y coordinates for a rectangle. The first pair sets the coordinates of the upper left corner of
rectangle. The second pair sets the coordinates of the lower right corner of the rectangle.
Circle
Circle shape indicates that the area is a circle. The first two numbers in the cords attribute
indicate the coordinates of the centre of the circle. The next number indicates the radius of the
circle.
Example: <area href=”image1.jpg” alt=”my image” shape=circle cords=”60,40, 44” > </area>
Poly
Poly shape indicates that the area is some type of polygon. For a polygon each pair of coordinate
in cords indicates the single corner of the polygon.
Example:
<area href=”image1.jpg” alt=”my image” shape=poly cords=”150,217, 190,257, 150,297, 110,257” > </area>
Default
Default indicates that the area isn’t really a shape but the href attribute applies to the whole area.
In this attribute coordinates are not given.
19
6. Forms
Opening an e-mail account on any site is preceded by filling up an e-form by the user. This form
asks the user’s personal details along with the desired username and password. This form consists
of various input boxes, buttons, labels and option buttons. This is followed by a display of the
rules and regulations, in other words; the dos and don’ts of using the e-mail account. An
acceptance of this by clicking on the ‘I Agree’ button fulfils all formalities of opening the e-mail
account.
There can be various kinds of forms besides an e-mail form in a web page. Forms make a web
page interactive. They are displayed by using various form elements like input boxes, buttons and
labels. HTML enables users to create forms with the help of these elements.
Form Tag
Forms are the most popular way to make a web page interactive. The form tag creates a form to
be input by the user. It can contain text fields, check boxes, radio buttons and more. Like any
form on paper, a form on a web page allows the user to enter requested information and submit it
for processing. It passes the user data to a specified URL.
Name
The name attribute takes up the value form name. It defines a unique name for the form. It is an
optional attribute.
Action
The action attribute takes up a URL as its value. It sends the data to the URL defined in action
when the submit button is pressed. It is an essential attribute.
Input Tag
The <input> tag defines the start of an input field where the user can enter his data. The input
tag is closed by a backslash (/) at the completion of the tag.
20
Attributes of Input Tag
Type
This attribute indicates the type of the input element. The default value is “text.”
The various values of type attributes are:
Button
A button is an input type that will not function without applying some extra code along with it. As
button is used while scripting, the concept of buttons will be discussed in detail later.
Checkbox
The checkbox value creates a checkbox which can either be on or off.
Hidden
The Hidden value indicates that the field is hidden. It gives the user the option of hiding the value
within it. Hidden is commonly used by programmers who do not want users to see the value
typed. The hidden value is still submitted with other information when the submit button is
clicked. It usually contains the page name and page number that the user is on.
Image
Image creates an image that is also a “submit” button. When the user clicks on the image, the
form is submitted. It also requires the “src” attribute like the image tag.
Password
Password indicates that the field is used for typing a password. Password works just like the text
type field, with the difference that whatever is typed is not displayed on the screen. Instead of
showing what has been typed, the browser displays a series of asterisks (*), bullets (.), or some
other symbol to indicate the typed but hidden values.
Radio
Radio is used to create a series of choices out of which only one can be selected. Selecting a radio
button option automatically deselects all other options. Several HTML radio buttons are created by
using the same name but different values.
Example:
<input type=radio name=”joke” value=”a”/> cricket jokes <br/>
<input type=radio name=”joke” value=”b”/> crazy jokes <br/>
21
Reset
The reset value resets the form to present it in its original form i.e. in the way before anything
was typed on it.
Submit
The submit value creates the submit button which submits the form to the server. There can be
two submit buttons on a form. To do this, the submit button has to be given the same name but
different values.
Example: <input type=submit value=”send it” />
Text
Text creates the text entry field, which is the most popular type of data entry field. Text is the
default-input type. If the text field is required there is no need to specify the type.
Name
The name attribute assigns a name to the input field. It is required in most circumstances. The
name of the input field is used to send the information to the server.
Value
Value sets the value for the input field. This sets the default value for text and password fields,
the button text in submit and reset buttons, and the values of choices in radio buttons.
The following example illustrates a form on a web page. This form will have all the tags and attributes that
have been discussed above:
Example:
<html>
<head>
<title> My list of jokes </title>
</head>
<body background ="myimage.jpg" text = “blue”>
22
SEX<br/>
<input type=radio name="sex" value="M"/> Male<br/>
<input type=radio name="sex" value="F"/> Female<br/>
</form>
</body>
</html>
Option Tag
The option tag is used with the <select> tag (which has been discussed later) to create select
lists. It indicates the start of a new option in the list. It is used with the value attribute, which
indicates what is sent to the server. The text that follows the option tag is the text that is
displayed in the browser.
Value
It indicates the value that is sent to the server if that option is selected. The user does not see the
value encrypted in the value attribute on the browser.
Example:
<select name=”jokenumber”>
</select>
Select Tag
The select tag creates a list of options, one or more of which can be selected. This tag in its
simplest form has a <select> tag, one or more <option> tags and a </select> tag.
Example:
<select name=”jokenumber”>
23
<option value=”001”> Cricket jokes </option>
<option value=”002”> Golf jokes </option>
<option value=”003”> Tennis jokes </option>
</select>
Name
The Name attribute names the select field for use in the server. It works similarly as it works with
the input tag.
Example:
<select name=”jokenumber”>
</select>
Size
The size attribute indicates how many rows of the list should be displayed. It indicates the number
of items that are shown in the drop down list. The default size is one.
Example:
</select>
Multiple
The Multiple attribute assigns more than one option from the list that can be selected. The size
attribute is particularly useful while creating multiple lists.
Example:
</select>
Optgroup Tag
The optgroup tag defines an option group. Various choices can be grouped with the help of this
tag. When there is a long list of options, groups of related choices are easier to handle. These
groups are user friendly and time saving.
Label
The label attribute defines a label for the option field. A label is a name for that particular option
group.
24
Example:
<select name=”jokenumber”>
</optgroup>
</optgroup>
</select>
Label Tag
The label tag defines a label to a control. When the text within the label is clicked, it will toggle
the control.
For
The for attribute defines the form element with which the label is associated. The text within the
for attribute in the label should be the same as the text in the id attribute of the control.
Example:
Textarea Tag
The textarea tag indicates a form field wherein the user can enter large amounts of text. An
unlimited number of characters can be written in the text-area. The default font of the text area is
fixed pitch.
Name
The name attribute sets the name of the form field. It works in a similar way as in the input field.
25
Cols and Rows
Cols indicate how many characters wide the textarea should be. Rows indicate how many rows
should be there in the textarea. This attribute sets just the visible area of the text.
Example:
Wrap
The wrap attribute describes how the text wraps at the end of lines. This attribute is given with
some values, which can be:
Soft
Soft wraps long lines in the text area for easy editing. It does not send the carriage return to the
server.
Hard
Hard looks similar to soft, but it sends the carriage returns to the server.
Off
Off does not wrap at all. It just displays and sends the text exactly as typed.
Example:
Example:
<html>
<head>
<title> My list of jokes </title>
</head>
<body background ="myimage.jpg" text = “blue”>
26
<h2 align=center>Additional Information </h2>
SEX<br/>
<select name="sex">
<option value="001"> Male </option>
<option value="002"> Female </option>
</select><br/>
SELECTION OF JOKES<br/>
<select name=”jokenumber”>
<optgroup label=”Game jokes”>
<option value=”001”> Cricket jokes </option>
<option value=”002”> Golf jokes </option>
</optgroup>
</form>
</body>
</html>
27
7. Tables
Information presented in a tabular form is always more popular than when they are displayed in
paragraph form. Tabular information is easy to understand, utilize and recollect. Tables contain
headings, rows and columns that simplify the otherwise cumbersome information and display the
data with greater clarity.
This chapter elucidates the concept of tables, their creation and customization. HTML tables
enable users to arrange data into tables; in the form of text, images, and forms etc. with the help
of rows and columns.
Several tags can be used to make tables in a web page. They are:
Table Tag
The <table> tag defines a table. Table headers, table rows, table cells and other tables can be
displayed inside the <table> tags.
Border
The border attribute establishes the size of the border surrounding the table. The default value is
0. When a border is set without a value, the default value is 1.
Example: <table border=2> </table>
Cellpadding
The cellpadding attribute sets the amount of space between the cell walls and the contents. The
default value for cellpadding is 1.
Cellspacing
The cellspacing attribute sets the amount of space between the cells of a table. If the borders are
visible cellspacing controls the width of internal borders.
Example: <table border=3 cellspacing=3> </table>
Width
The width attribute sets the width of the table. It can be expressed either as an absolute value in
pixels, or as a percentage of screen width.
Example: <table border=2 width=70%> </table>
Bgcolor
The Bgcolor attribute sets the background color of the entire table.
Example: <table border=1 bgcolor=yellow> </table>
28
Background
The background attribute sets the background image for the table.
Align
The align attribute sets the position of the table in relation to the page. It takes the value- left or right.
Bordercolor
The bordercolor attribute sets the color of all the borders of the table.
TR Tag
The <tr> tag designates a table row. Each <tr> tag contains one or more <td> i.e. table data or <th> i.e.
table header elements.
Example:
<table border=2>
<tr> <td>cricket jokes</td> <td> tennis jokes</td> <td>golf jokes</td> </tr>
<tr> <td>classic jokes</td> <td>soft jokes</td> <td>political jokes</td> </tr>
</table>
Attributes of TR Tag
Halign
Halign sets the horizontal alignment of cells in the row. It takes up the values left, center and right.
Valign
Valign sets the vertical alignment of the row. It can be set to top, middle, bottom or baseline.
Bgcolor
Bgcolor sets the background color for the table row.
Bordercolor
Bordercolor works similarly as with the <table> tag. The basic difference is that it only sets the colors of the
inside borders.
29
Example: <tr bordercolor=red> <td> common jokes </td> </tr>
TD Tag
The <td> tag sets a single table cell in which data is shown. Td means table data.
Example:
<tr>
<td> weird jokes </td>
<td> classic jokes </td>
</tr>
Align
Align sets the horizontal alignment of text within the table cell. It takes up the values left, center, and right.
Valign
Valign is the vertical alignment of text within the table cell. It takes up the values- top, middle, center,
bottom, and baseline.
Example:
<tr border=2>
<td colspan=2> jokes </td>
<td> classic jokes </td> <td> cricket jokes</td>
</tr>
Nowrap
Nowrap indicates that the text should not wrap in the cell. Nowrap does not wrap the text, no matter how
long the sentence is.
Example: <tr> <td nowrap> The text written in this sentence will not be wrapped in any case. </td> </tr>
Bgcolor
Bgcolor sets the background color of a single cell in a table.
Bordercolor
Bordercolor works similarly as it works with the <table> tag. It sets the color of the entire border around a
cell.
30
8. Frames
The concepts of HTML Frames are the next step towards empowering the user to add style to the web page.
HTML enables the designer to divide the space in the web page into several rectangular areas. Each of these
rectangular areas is known as a frame and each frame represents a separate document. With the help of
these frames, a part of the page can be kept stationary while the other parts can be scrolled or replaced.
In other words, Html frames define the display into multiple regions, some of which can be stationary and act
as links to other pages; while others can be scrolled. The designer can arrange the data into several windows
or windows according to his urgency and relevance.
Frame Tag
The <frame> tag sets a single frame in the framed page. The frame tag always goes inside a <frameset>
tag. It has various attributes, including the SRC attribute that indicates the URL of the page that goes in the
frame.
In the following example two frames are being made in one web page. The frame tag should be properly
closed by putting a backslash (/) at the end of the tag.
Example:
<frameset rows=”20%,*”>
<frame src= “title.html” name=”title”/>
<frame src=”body.html” name=”body”/>
</frameset>
Src
Src indicates the URL to be put into the frame.
Example:
<frameset rows=”20%,*”>
<frame src= “title.html” name=”title”/>
<frame src=”body.html” name=”body”/>
</frameset>
Note: Frames are not supported by the <body> element. The frames should be contained only within the <html> tag.
Name
Name defines a unique name for the frames. It works like the name attribute in other tags.
Example:
<frameset rows=”20%,*”>
<frame src= “title.html” name=”title”/>
<frame src=”body.html” name=”body”/>
</frameset>
31
Scrolling
Scrolling means that there should be a scrollbar on the right and/or on the bottom of the screen. It has three
values-yes, no and auto. Yes means there will be a scrollbar even when it is not needed. No means there will
not be a scrollbar even when it is needed. Auto is the default value that means there will be scroll bars as
and when needed.
Example:
<frameset rows=”20%,30%,*”>
<frame src= “title.html” name=”title” scrolling=yes/>
<frame src=”body.html” name=”body”/>
</frameset>
Noresize
Noresize means that the user cannot make the frame bigger or smaller by sliding the borders. Normally the
user can resize the border with a mouse. Noresize disables this ability.
Example:
<frameset rows=”20%,30%,*”>
<frame src= “title.html” name=”title” scrolling=yes noresize/>
Frameborder
Frameborder sets the border around the frames. It takes up two values- yes and no. Yes sets the border to
on and no sets the border to off. The default is yes.
Example:
<frameset rows=”20%,*”>
<frame src= “title.html” name=”title” frameborder=yes />
<frame src=”body.html” name=”body” frameborder=no />
</frameset>
Bordercolor
Bordercolor sets the color of the borders around the frame.
Example:
<frameset rows=”20%,*”>
<frame src= “title.html” name=”title” bordercolor=red/>
<frame src=”body.html” name=”body”/>
</frameset>
Marginwidth
Marginwidth sets the internal left and right margins of a frame.
Example:
32
<frameset rows=”20%,*”>
<frame src= “title.html” name=”title” marginwidth=2 />
<frame src=”body.html” name=”body”/>
</frameset>
Marginheight
Marginheight sets the internal top and bottom margins of a frame.
Example:
<frameset rows=”20%,*”>
<frame src= “title.html” name=”title”/>
<frame src=”body.html” name=”body” marginheight=30/>
</frameset>
NoFrames Tag
A large percentage of people on the web use browsers which cannot read frames. The
<noframes> tag holds the text that should be displayed for people who don’t have frames. It
should be the outermost frameset element.
Example:
<frameset rows=”20%,*”>
<frame src= “title.html” name=”title”/>
<frame src=”body.html” name=”body”/>
<noframes>
<p>this text is for those people who cannot view the frames.</p>
</noframes>
</frameset>
IFrame Tag
The <iframe> tag creates a web page, which has an inline frame that contains another document.
It creates a frame that sits in the middle of a regular non framed page. It works like the <img>
tag, the only difference being that instead of pitting a picture on the web page it puts up another
web page.
Example:
<iframe src=”hello.html”>
If you can see this then your browser does not understand iframes.
<frame src=”body.html” name=”body”/>
</iframe>
Src
Src indicates the URL of the document which should go in the frame.
Example:
<iframe src=”hello.html”>
33
If you can see this then your browser does not understand iframes.
</iframe>
Example:
<iframe src=”hello.html” width=450 height=100>
If you can see this then your browser does not understand iframes.
</iframe>
Name
Name indicates the name of the inline frame. It works in the same way as in the frame tag.
Example:
<iframe src=”tables.html” width=450 height=100 name=”tables”>
</iframe>
Frameborder
Frameborder indicates if the inline frame should have a border around it. The default value is 1, which sets a
border. When a border is not required then the value is set to 0.
Example:
<iframe src=”tables.html” width=450 height=100 name=”tables” frameborder=0>
</iframe>
Marginwidth
Marginwidth sets the internal left and right margins of the internal frame. It works similarly as it works in the
frame tag.
Example:
<iframe src=”tables.html” width=450 height=100 name=”tables” frameborder=0 marginwidth=2>
</iframe>
Marginheight
Marginheight sets the internal top and bottom margins of an inline frame. It works similarly as in the frame
tag.
Example:
<iframe src=”tables.html” width=450 height=100 name=”tables” frameborder=0 marginheight=2>
</iframe>
34
CSS
This chapter introduces a new concept known as Style sheets.
What is CSS?
Style sheets are also known as CSS that stand for Cascading Style Sheets. Style sheets give
web developers more control over their design and content layout. They allow designers to create
a standard set of commands that control the style of all the subsequent pages.
With the introduction of style sheets, standards are being set for the present and future of web
design. Style sheets assist designers to have control over their web site design and appearance
over different platforms and browsers.
The web sites designed in style sheets are faster to change and update.
Usually, in an HTML document; when the texture of all the web pages has to be changed, then
changes have to be made in all the pages. But when the designer is using style sheets, he just
has to make a change in the coding of the style sheet. This is the main benefit to designers and
companies as it speeds the time of development and updating. The coding is reduced, the pages
are more efficient and they require less bandwidth. Therefore communication is easier among
multiple developers because the work is standardized.
There is a set of rules that govern the making of a style sheet. These rules have to be followed
when style sheets are made. The rules are elaborated below:
1. The selector selects the element in which the author is working. The elements are common tags like
body, h1, pre, p, etc.
2. The declaration tells the browser what to do with the selected element. It consists of two parts:
* The property, which identifies which attribute, like font type, color, size etc. come into play.
* The value, which determines how the attribute works, like the value for the font
3. A declaration starts with a ‘{ ‘ (starting bracket) and ends with a ‘}’ (closing bracket).
35
4. A property is separated by a ‘:’(colon) and a declaration is ended by a ‘;’ (semicolon).
Example:
h1
{
Color: blue;
font-family: Arial, sand-serif;
}
An external style sheet is ideal when the style has to be applied to many web pages. Changing a
single file, with the help of external style sheet, can change the look of the entire web site. This is
because each page is linked to the style sheets using the <link> tag (which will be explained
later). The <link> tag is placed inside the head section. An external style sheet is saved with an
extension of .css. This file is used in the HTML document.
Example:
36
/* Anchor tag active Styles */
a: active
{
Color: #ff0000;
}
Example:
<head>
<link rel=”stylesheet” href=”mystyle.css” type=”text/css”/>
</head>
Example:
<head>
<style type=”text/css”>
body {background-color: red}
p {font-family : "courier new", courier}
</style>
</head>
37
Inline Styles
An inline style is used when a unique style is to be applied to a single occurrence of an element.
To use the inline tag the <style> tag is used in the relevant tag. The style tag can contain any
style sheet property. The following example shows how to change the color and left margin of a
paragraph.
Example:
Note:
In an HTML element, if all three style sheets are used then the order of preference is as follows: Firstly, inline style sheet
will be used; secondly, internal style sheet; and lastly, external style sheet will be used. If style for an HTML tag has been
defined in all the style sheets, then only the style of inline style sheet will be used.
Link Tag
The link tag defines the relationship between two linked documents. This tag lets a style sheet to
be linked to an HTML document.
Href
In this attribute, the target URL of the resource has to be given. It means that the URL of the
document has to be given; which is to be linked with the HTML document.
Type
Type defines the content type of the link tag. It takes up the value text/css. These two values are
given together and separated by a slash (/). It means that either of these two values could be
used.
Example:
<head>
<link href=”mystyle.css” type=”text/css” />
</head>
Rel
Rel defines the relationship between the current document and the targeted document. In this the
value of rel should be given as stylesheet.
Example:
<head>
<link rel=”stylesheet” href=”mystyle.css” type=”text/css” />
</head>
38
Style Tag
The style tag defines a style in a document. The style tag is placed in the head section of an HTML
document for an internal style sheet. The style element is also used with the HTML tag and it is
placed inside that tag for inline style sheets.
Example:
<head>
<style type=”text/css”>
</style>
</head>
Example:
<p style=”color: red; margin-left: 20px” >
</p>
Type
Type defines the content type of the style tag. It takes up the value text/css. These two values are
given together and separated by a slash (/). It means that either of these two values could be
used.
Example:
<head>
<style type=”text/css”>
</style>
</head>
Div Tag
The div tag defines a division or section in a document. It makes a logical division in a document.
The function of the div tag does is that it leaves a white space before and after the div tag. In this
way logical divisions can be made.
39
Example:
<div style=”color:#FF0000;”>
<h3> This is a header in this div section </h3>
</div>
<div style=”color:#CCCC99;”>
<p> This is a paragraph in another div section </p>
</div>
Span Tag
The span tag groups inline elements and formats them with styles in a document.
For example, if some lines in a paragraph have to be formatted differently than the rest of the
lines, then, the span tag is used. Those lines whose format is to be changed are put between the
span tags and the span tags are contained in the paragraph tags. The span tag can be used
between any set of tags.
Example:
<p> This is the first line in a paragraph.
Background Properties
div { background-
Valid color names, RGB color:green; }
Declares the background
background-color values, hexidecimal
color.
notation. div { color:#00FF00; }
40
div { background-
image:url(images/img.jpg);
}
Declares the background
background-image URL values.
image of an element.
body { background-
image:url(img.jpg); }
div { background-
repeat repeat:repeat-x; }
Declares how and/or if a
repeat-x
background-repeat background image
repeat-y div { background-
repeats.
no-repeat repeat:no-repeat; }
Separate values by a
space in the following
order (those that are not div { background:green
defined will use inherited url(image.jpg) no-repeat
Used as a shorthand or default initial values): fixed center center; }
property to set all the
background
background properties at background-color div
once. background-image { background:url(image.jpg
background-repeat ) fixed; }
background-attachment
background-position
41
Border Properties
none
hidden
dotted div { border-top-style:solid;
dashed }
Declares the style of the solid
border-top-style
top border. double div { border-top-style:inset;
groove }
ridge
inset
outset
Lengths or the following
div { border-top-
predefined values:
width:2px; }
Declares the width of the
border-top-width thin
top border. div { border-top-
medium
width:thin; }
thick
Separate values by a
space in the following
order (those that are not div { border-top:2px solid
Used as a shorthand defined will use inherited green; }
property to set all the or default initial values):
border-top
border-top properties at div { border-top:thick
once. border-top-width double #00FF00; }
border-top-style
border-top-color
div { border-right-
Valid color names, RGB color:green; }
Declares the color of the values, hexidecimal
border-right-color
right border. notation, or the predefined div { border-right-
value transparent. color:#00FF00; }
42
double
groove style:inset; }
ridge
inset
outset
Lengths or the following
div { border-right-
predefined values:
width:2px; }
Declares the width of the
border-right-width thin
right border. div { border-right-
medium
width:thin; }
thick
Separate values by a
space in the following
order (those that are not div { border-right:2px solid
Used as a shorthand defined will use inherited green; }
property to set all the or default initial values):
border-right
border-right properties at div { border-right:thick
once. border-right-width double #00FF00; }
border-right-style
border-right-color
div { border-bottom-
Valid color names, RGB color:green; }
Declares the color of the values, hexidecimal
border-bottom-color
bottom border. notation, or the predefined div { border-bottom-
value transparent. color:#00FF00; }
none
hidden
dotted div { border-bottom-
dashed style:solid; }
Declares the style of the solid
border-bottom-style
bottom border. double div { border-bottom-
groove style:inset; }
ridge
inset
outset
Lengths or the following
div { border-bottom-
predefined values:
width:2px; }
Declares the width of the
border-bottom-width thin
bottom border. div { border-bottom-
medium
width:thin; }
thick
43
defined will use inherited
or default initial values):
div { border-bottom:thick
at once. border-bottom-width double #00FF00; }
border-bottom-style
border-bottom-color
div { border-left-
Valid color names, RGB color:green; }
Declares the color of the values, hexidecimal
border-left-color
left border. notation, or the predefined div { border-left-
value transparent. color:#00FF00; }
none
hidden
dotted div { border-left-
dashed style:solid; }
Declares the style of the solid
border-left-style
left border. double div { border-left-style:inset;
groove }
ridge
inset
outset
Lengths or the following
div { border-left-
predefined values:
width:2px; }
Declares the width of the
border-left-width thin
left border. div { border-left-
medium
width:thin; }
thick
Separate values by a
space in the following
order (those that are not div { border-left:2px solid
Used as a shorthand defined will use inherited green; }
property to set all the or default initial values):
border-left
border-left properties at div { border-left:thick
once. border-left-width double #00FF00; }
border-left-style
border-left-color
border-color Declares the border color Valid color names, RGB div { border-color:green
of all four borders at once. values, hexidecimal red blue olive; }
notation, or the predefined
value transparent. div { border-color:green; }
44
borders in the following
order:
border-top-color
border-right-color
border-bottom-color
border-left-color
45
style, the right and left
borders will use the
second style, and the
bottom border will use the
third style.
thin
medium
thick
Separate values by a
space in the following
order (those that are not div { border:1px double
Used as a shorthand to defined will use inherited green; }
declare the border or default initial values):
border properties when all four
div { border:thin solid
borders will have the same
border-width #00FF00; }
appearance.
border-style
border-color
46
Classification and Positioning Properties
auto
crosshair
default div { cursor:crosshair; }
pointer
move div
e-resize { cusrsor:url(image.csr); }
Declares the type of cursor
cursor ne-resize
to be displayed.
nw-resize div
n-resize { cusrsor:url(image.csr),
se-resize pointer; }
sw-resize
s-resize
w-resize
text
wait
help
none
inline
block
list-item
run-in
compact div { display:none; }
marker
table div { display:inline; }
Declares if/how the
display inline-table
element displays.
table-row-group
table-header-group div { display:marker; }
table-footer-group
table-row
table-column-group
table-column
table-cell
table-caption
float Declares whether a box left div { float:left; }
should float to the left or right
right of other content, or none div { float:right; }
whether it should not be
47
floated at all.
div { visibility:visible; }
Declares the visibility of visible
visibility boxes generated by an hidden
div { visibility:hidden; }
element. collapse
48
shape is a rectangle, using
the following format to
specify the offset lengths
other than visible. from each side of the box: 7px, 5px); }
div { z-index:2; }
Declares the stack order of Integer values and the
z-index
the element. predefined value auto. div { z-index:auto; }
Dimension Properties
div { max-height:200px; }
Declares the maximum Lengths, percentages, and
max-height
height of the element. the predefined value auto. div { max-height:50%; }
49
div { min-height:200px; }
Declares the minimum Lengths, percentages, and
min-height
height of the element. the predefined value auto. div { min-height:50%; }
div { width:500px; }
Declares the width of the Lengths, percentages, and
width
element. the predefined value auto. div { width:75%; }
div { max-width:500px; }
Declares the maximum Lengths, percentages, and
max-width
width of the element. the predefined value auto. div { max-width:75%; }
div { min-width:500px; }
Declares the minimum Lengths, percentages, and
min-width
width of the element. the predefined value auto. div { min-width:75%; }
Font Properties
50
Lengths (number and unit
type— i.e. 1em, 12pt,
10px, 80%) or one of the
following predefined
values:
div { font-size:70%; }
Declares the size of the xx-small
font. Previously set in x-small div { font-size:0.85em; }
font-size
HTML via the size attribute small
in a <font> tag. medium div { font-size:medium; }
large
x-large
xx-large
smaller
larger
Limited browser
support: Was part of
CSS 2, but not in CSS div { font-size-
2.1. This property may adjust:0.54; }
return in CSS 3.
font-size-adjust Numeric value
div { font-size-
Declares the aspect value adjust:0.46; }
(font size divided by x-
height).
normal
Limited browser wider
support: Was part of narrower div { font-
CSS 2, but not in CSS ultra-condensed stretch:narrower; }
2.1. This property may extra-condensed
font-stretch return in CSS 3. condensed
div { font-stretch:ultra-
semi-condensed
expanded; }
Declares the stretch of the semi-expanded
font face. expanded
extra-expanded
ultra-expanded
div { font-style:italic; }
normal
font-style Declares the font style. italic
div { font-style:oblique; }
oblique
div { font-variant:normal; }
normal
font-variant Declares the font variant. div { font-variant:small-
small-caps
caps; }
51
bolder
lighter
100
200
300 div { font-weight:200; }
400
500
600
700
800
900
Separate values by a
space in the following
order (those that are not
defined will use inherited
div { font:italic small-caps
Used as a shorthand or default initial values):
bold 1em 1.2em Arial }
property to declare all of
font the font properties at once font-style
div { font:bold 0.8em
(except font-size-adjust font-variant
Verdana }
and font-stretch). font-weight
font-size
line-height
font-family
counter(name)
counter(name, list-style- div:before { content:"some
Generates content in the type) text"; }
document in conjunction counters(name, string)
content
with the :before and :after counters(name, string, list- div:after
pseudo-elements. style-type) { content:url(page2.html); }
attr(X)
open-quote
close-quote
no-open-quote
no-close-quote
52
Declares the counter
Integers and the
counter-increment increment for each More Information
predefined value none.
instance of a selector.
Declares the value the
Integers and the
counter-reset counter is set to on each More Information
predefined value none.
instance of a selector.
Declares the type of
quotation marks to use for String values and the
quotes More Information
quotations and embedded predefined value none.
quotations.
List Properties
53
Declares an image to be ul { list-style-
list-style-image URL values.
used as the list marker. image:url(image.jpg); }
Separate values by a
space in the following
order (those that are not ul { list-style:disc inside
defined will use inherited url(image.gif); }
Shorthand property to or default initial values):
list-style declare three list
ol { list-style:upper-roman
properties at once.
list-style-type outside; }
list-style-position
list-style-image
Margin Properties
div { margin-right:5px; }
Declares the right margin Lengths, percentages, and
margin-right
for the element. the predefined value auto. div { margin-right:15%; }
div { margin-bottom:5px; }
Declares the bottom Lengths, percentages, and
margin-bottom
margin for the element. the predefined value auto. div { margin-bottom:15%; }
div { margin-left:5px; }
Declares the left margin Lengths, percentages, and
margin-left
for the element. the predefined value auto. div { margin-left:15%; }
54
Separate values by a
space in the following
order (those that are not
defined will use inherited
or default initial values):
margin-top
margin-right
margin-bottom
margin-left
div { margin:5px 12px 4px
Undeclared values work 7px; }
as further shorthand
Shorthand property used notation. If only one length div { margin:5px; }
margin to declare all the margin value is declared, all four
properties at once. margins will use that div { margin:5px 10px; }
length. If two lengths are
declared, the top and
bottom margins will use div { margin:5px 7px 4px; }
the first length while the
right and left margins will
use the second length. If
three lengths are declared,
the top margin will use the
first length, the right and
left margins will use the
second length, and the
bottom margin will use the
third length.
Outline Properties
none
dotted
dashed div { outline-style:solid; }
solid
Declares the style of the
outline-style double
outline. div { outline-style:inset; }
groove
ridge
inset
outset
55
Lengths or the following
predefined values:
div { outline-width:2px; }
Declares the width of the
outline-width thin
outline. div { outline-width:thin; }
medium
thick
Padding Properties
div { padding-right:5px; }
Declares the right padding Lengths, percentages, and
padding-right
for the element. the predefined value auto. div { padding-right:15%; }
div { padding-bottom:5px; }
Declares the bottom Lengths, percentages, and
padding-bottom div { padding-
padding for the element. the predefined value auto.
bottom:15%; }
div { padding-left:5px; }
Declares the left padding Lengths, percentages, and
padding-left
for the element. the predefined value auto. div { padding-left:15%; }
56
Separate values by a
space in the following
order (those that are not
defined will use inherited
or default initial values):
padding-top
padding-right
padding-bottom
padding-left div { padding:5px 12px 4px
7px; }
Undeclared values work
as further shorthand div { padding:5px; }
Shorthand property used notation. If only one length
padding to declare all the margin value is declared, all four div { padding:5px 10px; }
properties at once. sides will use that length. If
two lengths are declared,
the top and bottom sides div { padding:5px 7px
will use the first length 4px; }
while the right and left
sides will use the second
length. If three lengths are
declared, the top side will
use the first length, the
right and left sides will use
the second length, and the
bottom side will use the
third length.
Page Properties
57
auto
always
page-break-after Declares a page break. avoid More Information
left
right
auto
always
page-break-before Declares a page break. avoid More Information
left
right
auto
page-break-inside Declares a page break. More Information
avoid
Lengths, and the following
predefined values:
Declares the size and
size auto More Information
orientation of a page box.
landscape
potrait
Table Properties
58
caption { caption-
top side:top; }
Declares where the table
bottom
caption-side caption is displayed in
left caption { caption-side:right;
relation to the table.
right }
table { table-layout:auto; }
Declares the type of table auto
table-layout
layout. fixed table { table-layout:fixed; }
Text Properties
aqua
black
div { color:green; }
blue
fuchsia
Declares the color of the gray div { color:rgb(0,255,0); }
color
text. green
lime div { color:#00FF00; }
maroon
navy
olive
purple
red
silver
teal
white
yellow
59
ltr
rtl div { direction:ltr; }
Declares the reading
direction
direction of the text. ltr = left-to-right div { direction:rtl; }
rtl = right-to-left
div { line-height:normal; }
Numbers, percentages,
Declares the distance lengths, and the div { line-height:2em; }
line-height
between lines. predefined value of
normal. div { line-height:125%; }
div { letter-spacing:normal;
}
A length (in addition to the
Declares the amount of
default space) or the div { letter-spacing:5px; }
letter-spacing space between text
predefined value of
characters.
normal.
div { letter-spacing:-1px; }
left
right
center
justify div { text-align:center; }
div { text-
none decoration:none; }
underline
Declares the text
text-decoration overline
decoration. div { text-
line-through
decoration:underline; }
blink
div { text-indent:12px; }
Declares the indentation of
text-indent Lengths and percentages.
the first line of text. div { text-indent:2%; }
60
The color for the shadow
effect
Horizontal distance to the
right of the text -3px -4px 5px; }
Vertical distance below the
text
Blur radius
div { text-
none transform:uppercase; }
Declares the capitalization
capitalize
text-transform effects on the letters in the
uppercase div { text-
text.
lowercase transform:lowercase; }
div { unicode-bidi:embed; }
Declares values relating to
normal
bidirectional text. May be
unicode-bidi embed div { unicode-bidi:bidi-
used in conjunction with
bidi-override override; }
the the direction property.
div { white-space:pre; }
normal
Declares how white space
white-space pre
is handled in an element. div { white-space:nowrap; }
nowrap
div { word-
A length (in addition to the spacing:normal; }
Declares the space default space) or the
word-spacing
between words in the text. predefined value of div { word-
normal. spacing:1.5em; }
61
Other Properties
left-side
far-left
left div { azimuth:90deg; }
Declares the angle that
center-left
azimuth sound travels to the
center div { azimuth:behind; }
listener.
center-right
right
far-right
right-side
behind
leftwards
rightwards
div { cue-
after:url(sound.wav); }
Declares an audio cue to URL values and the
cue-after
play after an element. predefined value none.
div { cue-after:none; }
div { cue-
before:url(sound.wav); }
Declares an audio cue to URL values and the
cue-before
play before an element. predefined value none.
div { cue-before:none; }
62
values:
below
level div { elevation:higher; }
above
higher
lower
div { pause-after:100ms; }
Declares the amount of
Time in milliseconds (ms)
pause-after time to pause after an
or percentages. div { pause-after:20%; }
element.
div { pause-
Declares the amount of before:100ms; }
Time in milliseconds (ms)
pause-before time to pause before an
or percentages.
element. div { pause-before:20%; }
63
mix
repeat
div { play-
during:url(music.wav)
Alternatley, one of the repeat; }
following keywords:
div { play-during:none; }
auto
none
th { speak-header:once; }
Declares how often table once
speak-header th { speak-
header cells are spoken. always
header:always; }
div { speak-
numeral:digits; }
Declares how numerals digits
speak-numeral
are spoken. continuous div { speak-
numeral:continuous; }
div { speak-
punctuation:code; }
Declares how punctuation code
speak-punctuation
is spoken. none div { speak-
punctuation:none; }
speech-rate Declares the speech rate A number indicating the div { speech-rate:50; }
of spoken text. number of words per
minute, or one of the div { speech-
following predefined rate:medium; }
values:
x-slow
slow
medium
fast
x-fast
64
faster
slower
65
Dreamweaver
1. Introduction
Adobe Dreamweaver is an easy to use web development application that covers up the gap
between a developer and a designer. Dreamweaver is a powerful web development tool that helps
you create attractive, dynamic, powerful websites. It includes advanced features to develop
complex data-driven web applications. Dreamweaver’s user friendly interface and extensive library
not only enables even the amateur web designers to create professional websites easily, but helps
one to structure the websites in such a way that they are easy to maintain after being built.
2. Dreamweaver Interface
Dreamweaver has a very easy and user friendly interface that lets the user develop and manage simple as
well as complex websites. The interface features in Dreamweaver allows the user to quickly create web pages
in the WYSIWYG mode. The various elements and assets can be dragged directly into the document from an
easy to use panel. Developers can work directly with the page's code, making use of the various tools
Dreamweaver provides for ensuring correct syntax. Dreamweaver comes with the support to directly import
images created using Fireworks and other graphics applications.
In Windows, Dreamweaver provides an all-in-one-window integrated layout. In the integrated workspace, all
windows and panels are integrated into a single larger application window.
The toolbars contain the common commands. Many of these commands are also available in the
Dreamweaver menus. Additional commands are available in the panel groups found on the right side of the
Dreamweaver window; you can expand and collapse these groups as necessary. The Property inspector lets
you examine and edit the most common properties for the currently selected page element, such as text or
an inserted object. We will go through the brief introduction of each of these features.
Insert Bar
You can use the insert bar to create and insert objects such as tables, layers and images. It includes images,
hyperlinks, tables, forms, and multimedia objects. When the mouse is rolled over a button, its tooltip comes
up with the name of the command button. These command buttons are organized into categories. These
categories can be switched on the left side of the bar. In addition to this the categories also appear when the
current document contains server code such as ASP or Coldfusion documents.
66
The various categories that these command buttons are grouped into are
Common - The default category, which contains commands for adding hyperlinks, tables, images,
and multimedia objects.
Layout - It is used for designing the layout of the page, with the help of commands for tables,
layers, and framesets.
Text - Contains commands for applying various formatting to the text on your page, as well as for
inserting special characters.
HTML - Lets you select various HTML tags to insert into your page.
Flash Elements - Lets you insert a Flash movie into your page.
Favorites - Lets you customize your own toolbar by grouping your favorite commands.
To show or hide the Insert toolbar, open the View menu and select Toolbars, and then Insert.
Document Toolbar
The Document Toolbar can be used to toggle between different view modes i.e., Code, Design and
Split View mode. In addition, there are some common commands related to viewing the document
and transferring it between the local and remote sites. There are commands for naming,
previewing, and publishing the current document:
67
Show Code View - displays only the Code view in the Document window.
Show Code and Design Views - displays Code view in part of the Document window and Design
view in another part. When you select this combined view, the option Design View on Top
becomes available in the View Options menu. Use this option to specify which view appears at the
top of your Document window. Code view is updated automatically when you make changes in
Design view. However, after making changes in Code view, you must manually update the
document in Design view by clicking in Design view or pressing F5.
Show Design View - displays only the Design view in the Document window.
Document Title - Lets you specify a title for the page, which appears in the title bar of the
browser's viewer.
No Browser/Check Errors - Provides a menu of options for checking browser compatibility with
the page.
Validate Markup - lets you validate the current document or a selected tag.
File Management - Provides a menu of file management options for the page, including a
command to upload the page to your web server.
Preview/Debug in Browser - Lets you preview the page in the browser you select.
Refresh Design View - Refreshes the appearance of the page in Design view after you've made
changes to it in Code view.
View Options - Lets you specify various settings for the current view.
Visual Aids - lets you use different visual aids to design your pages.
If you don't see the Document toolbar, open the View menu and select Toolbars, and then
Document to show it.
Document Window
The Document window shows the current document in either of the view modes among Design
View, Code View and Split View. The Design View mode is used for visual page layout, visual
editing and rapid application development. In the Design View mode the document is available as
a fully editable visual representation similar to the final output that you would be seeing in the
browser.
68
Code view provides the user with hard-core coding environment for writing and editing HTML and
Javascript code as well as the backend server language code like PHP, coldfusion, ASP etc.
The Split view mode lets the user view both code and design view in the same window.
The title bar displays the title of the page and the file’s path and name. An astrisk is displayed
after the name if any changes have not been saved.
When a Document window is maximized, tabs appear at the top of the Document window area
showing the filenames of all open documents. To switch to a document, click its tab.
Panel Groups
The Dreamweaver Panel Groups are displayed vertically on the right side of the Dreamweaver
window. Panel groups are collection of related panels and commands you will use to design your
pages andbuild and publish your web site.
A Panel group can be collapsed or expanded and docked or undocked along with the other panel
groups. A panel appears as a tab in the panel group when selected.
The commands available in the panel groups are far more extensive than the ones you'll find on
the Insert bar, which contains the most common Dreamweaver commands.
Each panel includes an Options menu in the upper right corner, which contains additional options
for that panel.
69
Code Panel Group
You can use the Code panel group to work with the code in the document like HTML, JavaScript,
and ASP. You can save code snippets using the Snippets panel, which can be reused later. The
Reference panel contains HTML reference library.
70
Files and Assets Panels are part of the Files Panel Group. The File panel is used for managing the
website files like downloading and uploading files to and from the web server. This panel can also
be used for defining new websites and to switch among various sites.
Status Bar
The status bar contains addition information about the document. The status bar is located at the
bottom of the document window.
Tag Selector
The tag selector displays the hierarchy of tags surrounding the selection. You can Click any tag in
the hierarchy to select that tag and all its contents. Clicking on the <body> selects the entire
body of the document. Right-click (Windows) or Control-click (Macintosh), select a class or ID
from among the items in the context menu to set the class or id attributes for a tag in the tag
selector.
Hand Tools
The Hand tool is used to drag the document in the document window. Clicking on the Select tool
disables the Hand tool.
The zoom tool and the Set Magnification pop-up menu let you set a magnification level for your
document. It can be used for checking the pixel accuracy of graphics, to select small items more
easily, design pages with small text, design large pages, and so on.
71
Window Size pop-up Menu
Window size pop-up menu lets you resize the Document window to predetermined or custom
dimensions. This menu is only visible in the Design view mode. The status bar displays the
Document window’s current dimensions (in pixels). In order to design a page that looks its best at
a specific size, you can adjust the Document window to any of the predetermined sizes, edit those
predetermined sizes, or create new sizes.
This shows the estimated document size and estimated download time for the page, including all
dependent files such as images and other media files. The size is calculated based on the entire
contents of the page, including all linked objects, such as images and plug-ins. The download time
is estimated based on the connection speed entered in the Status Bar preferences.
In addition to the user interface entities shown in the default UI view, there are more toolbars like
the Coding Toolbar, The Style Rendering toolbar and tools like Reports in dreamweaver.
The Coding toolbar has buttons are used to perform many standard coding operations, like
highlighting invalid code, collapsing and expanding code selections, editing comments, indenting
code, inserting recently used code snippets etc.
The Coding toolbar is visible only in Code view and appears vertically on the left side of the
Document window.
72
73
2. Making Websites
Making Website
Creating a Website
The term Web site is a fairly generic one. In general way when you talk about a "web site", you
mean a collection of related, interconnected web pages.
1. The Dreamweaver Files and Assets panels make it easy for you to manage your site files.
Choose Site, then Manage Sites from the drop down menu. This brings up the Manage
Sites dialog box, as shown in given figure. Click new.
74
2. You are given the choice between setting up a new site or an FTP connection. For our
purpose, just select site. The site definition Wizard appears, as shown in given Figure.
There are two tabs in this dialog box. Select the Advanced tab and enter your own
specifications and make sure the Local info category is selected.
3. Set the Site name as Home and to set the local root folder, click on the browse button to
the right of the Local root folder field. Click the Create New Folder button and call this
folder Home too. Select this folder and click select.
4. To set the default image folder,click on the Browse button and navigate to the the c:\Home
folder you just created. Click the Create new folder button and call the new folder
images.Select that folder and click select.
75
5. Set the HTTP Address field to http://<your server>/Home. Here your server is the web
address of the web server you are using to test the web site. Enable Cache option checked.
Don't click ok.
6. Chek the Remote info category on the left. From the drop down list called Access. Change
its value from none to local/Networks. To set the Remote Folder field, Use the browse
button to navigate to the folder. Create New folder button to add a folder called Home and
select that folder. Make sure the Refresh remote file list automatically, Maintain
synchronization information and Automatcally upload files to server on save option is
checked. Don't click ok.
76
7. Click the Testing Server category. Set the Server Model to None. From the Access drop–
down list's value, change None to Local/Network. This time, the Testing server folder and
URL prefix values should automatically be filled as shown in given figure. Make sure that
the Refresh remote file list automaticlly is selected and then click ok. This creates the site
in Dreamweaver. Select Done on the Manage Sites dialog box.
77
8. Select the Site panel from Files panel group or press F8 to see the site you just created as shown in
given figure below.
78
Inserting and Formatting Tables
Tables let you precisely control the position of elements in your web pages. To design a page using
a table, you insert the table first, adjusting it as necessary to define the layout of the page. Then
you insert text, images, and other elements into the individual table cells. On the Insert bar, click
the Table button. The Insert Table dialog opens.
Enter the specifications you want in the table and Use the Header section to specify the location of
the header contents in your table. If you think the table looks a little too cramped, you can adjust
its size by clicking on any inner cell-border and drag it to the position you want. You can also
enlarge the whole table by selecting <table> in the tag selector.
79
Adding Characters
1. Place the cursor where you want to insert the special character.
2. Open the Insert menu and select HTML, and then Special Characters.
3. From the Special Characters submenu, select Other.
In the Insert Other Character dialog, click the character you want to insert and then click OK
80
You can also validate your document by selecting File -> Check Page -> Validate Markup (for
HTML) or File -> Check Page -> Validate as XML (for XHTML).
You can choose to validate the current document, the entire site, or just selected files in the site.
The validator preferences can also be set here. The document should validate as XHTML 1.0
Transitional without needing to be edited by hand.
HTML has many different versions, all of which Dreamweaver can validate, but the default settings
may not accomodate the required HTML version. So, we simply need to amend the validator's
settings.
To edit the validator settings, right click in the results panel, and select "Settings"
A new dialog window will open, with a whole range of document standards listed. Don't worry
about what all of these are, just scroll the list for now, unchecking every option that is checked.
When this is done, find "XHTML 1.0 Transitional" and check the box beside it.
Now, back at your page, hit SHIFT + F6 again to re-validate the page.
81
Using the W3C Validator
Although the internal validator is a useful tool when working on your documents within Dreamweaver,
validating at the W3C makes a good final check. The URL for the W3C HTML validator is
http://validator.w3.org.
The W3C tool allows you to validate by entering the URL of the page that requires validation or by uploading
the document. The easiest way to validate your pages is to FTP them to your web site and then enter the
URL into the appropriate box at the validator. If you are using the Dreamweaver validator as you work on
your site, you will probably only need to check with the W3C validator as part of your final testing to ensure
that all documents, including those that contain dynamic data, are valid.
In the Results panel (Window > Results), select the Browser Compatibility Check tab.
Click the green arrow in the upper-left corner of the Results panel and select Settings.
Select the checkbox next to each browser you want to check against.
For each selected browser, select a minimum version to check against from the corresponding pop-up
menu.
For example, to see if CSS rendering bugs might appear in Internet Explorer 5.0 and later and Netscape Navigator 7.0
and later, select the checkboxes next to those browser names, and select 5.0 from the Internet Explorer pop-up menu and
7.0 from the Netscape pop-up menu.
82