home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


<SCRIPT>

Type:

Container

Function:

Contains script code referenced in the body of the document.

Syntax:

<SCRIPT LANGUAGE=”scripting_language”>
... script code goes here ...
</SCRIPT>

Attributes:

The <SCRIPT> tag can take the following attributes:

  CHARSET—Denotes which character encoding scheme to use.
  DEFER—Specifying the DEFER attribute tells the browser that the script does not generate any document content. This enables the browser to continue parsing and rendering the document without having to execute the script.
  LANGUAGE—Set equal to the scripting language used to write the script. LANGUAGE is being deprecated in favor of using the TYPE attribute.
  SRC—Specifies the URL of a file containing the script code, if not contained between the <SCRIPT> and </SCRIPT> tags.
  TYPE—Set equal to the MIME type of the script code, usually text/javascript or text/vbscript. When specifying a specific version of a scripting language, you can set TYPE equal to a value that includes version information as well (for example, TYPE=”text/javascript1.1"). TYPE is a required attribute under HTML 4.0.
<SCRIPT LANGUAGE=”VBScript”>
<!--
Sub ScriptEx
document.write(“<HR>”)
document.write(“<H1 ALIGN=CENTER>Thank you for your submission!</H1>”)
document.write(“<HR>”)
-->
</SCRIPT>


NOTE:  Script code is often placed between <!-- and --> tags so that browsers that can’t process scripts will treat the code as a comment.

Related Tags:

You can use the <NOSCRIPT> tag to specify what a browser should do if it is unable to execute a script contained in the <SCRIPT> and </SCRIPT> tags.

<NOSCRIPT>

Type:

Container

Function:

Provides alternate content to use if a script cannot be executed. A browser might not be able to execute a script because the user has turned scripting off or because it does not know the scripting language used to write the script.

Syntax:

<NOSCRIPT>
... alternative to script code goes here ...
</NOSCRIPT>

Attributes:

None.

Example:

<SCRIPT LANGUAGE=”VBScript”>
   document.write(“Hello, World!”);
</SCRIPT>
<NOSCRIPT>
   You either have scripting turned off or your browser does not
   understand VBScript.
</NOSCRIPT>

<STYLE>

Type:

Container

Function:

Specifies style information for the document.

Syntax:

<STYLE TYPE=”mime_type” MEDIA=”media_type” TITLE=”title”>
... style information goes here ...
</HTML>

Attributes:

The <STYLE> tag takes the following three attributes:

  MEDIA—Specifies what media types the styles are to be used for (visual browser, speech-based browser, Braille browser, and so on).
  TITLE—Gives the style information a descriptive title.
  TYPE—Set equal to the Internet content type for the style language. You will most likely say TYPE=”text/css1" to denote the use of the style language put forward in the Cascading Style Sheets, Level 1 specification. TYPE is a required attribute of the <STYLE> tag.

Example:

<STYLE TYPE=”text/css1">
<!--
   BODY {font: 10 pt Palatino; color: silver margin-left: 0.25 in}
   H1 {font: 18 pt Palatino; font-weight: bold}
   H2 {font: 16 pt Palatino; font-weight: bold}
   P {font: 12 pt Arial; line-height: 14 pt; text-indent: 0.25 in}
-->
</STYLE>


NOTE:  Style information is usually contained between <!-- and --> tags so that browsers that cannot process it will treat the style information as a comment.

<TITLE>

Type:

Container

Function:

Gives a descriptive title to a document. Use of the <TITLE> tag is required by the HTML 4.0 DTD for many good reasons. Titles show up in browser window title bars and in bookmark and history listings. In each of these cases, you provide an important reader service when you specify a title because otherwise the browser will display just the document’s URL. Additionally, Web search engines, such as Yahoo! and AltaVista, frequently look for title information when they index a document.

Syntax:

<TITLE> ... document title goes here ... </TITLE>

Attributes:

None.

Example:

<TITLE>
The Advantages of a Corporate Web Site
</TITLE>

Try to keep titles to 40 characters or fewer so that browsers can display them completely.

<BDO>

Type:

Container

Function:

When mixing languages in an HTML document, it sometimes becomes necessary to be sensitive to the direction in which the language is read (left-to-right versus right-to-left). When languages that have mixed directions are used in a document, an approach called the bidirectional algorithm is used to ensure proper presentation of the content. In cases where you want to override the bidirectional algorithm for a block of text, you can enclose that text in the <BDO> and </BDO> tags.

Syntax:

<BDO DIR=”LTR|RTL”> ... directional text goes here ... </BDO>

Attributes:

The <BDO> tag takes the DIR attribute, which can be set to LTR to specify left-to-right directionality or to RTL to specify right-to-left directionality.

Example:

<BODY LANG=”he” ...> <!-- Hebrew language context - RTL directionality>
... <BDO DIR=”LTR”>Here’s some English text.</BDO> ...
...
</BODY>

<BODY>

Type:

Container

Function:

Contains all content and tags that compose the document body.

Syntax:

<BODY BGCOLOR=”background_color” BACKGROUND=”background_image”
   LINK=”unvisited_link_color” ALINK=”active_link_color”
   VLINK=”visited_link_color” TEXT=”text_color”>
 ... document body goes here ...
</BODY>


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.