1.WEB PUBLICATION - Tags
1.WEB PUBLICATION - Tags
Web Publishing
In following table the keyword ‘Optional’ indicates that respective tag is not necessary to use to create a web page. ‘Required’ means the tag
is necessary to provide the effect to the web page. ‘Forbidden’ means the tag is not allowed in HTML language.
HTML Tags
1
Reference book for IT
Web Publishing
To hide the information in HTML document
Contains information that is not to be displayed in a web page. It
<COMMENT> Paired Required/Required
works only in Internet Explorer.
<!-- … --> Contains information that is not to be displayed in a web page. It
--- None
(Comments) works in all browsers.
Creating a lists
2
Reference book for IT
Web Publishing
<LI> Defines a list item within a bullet list. Attributes: TYPE,VALUE Paired Required/Optional
<UL> Creates an unordered list. Attributes: TYPE, COMPACT Paired Required/Required
Creates an ordered or numbered list.
<OL> Paired Required/Required
Attributes: TYPE, COMPACT, START
<DL> Creates a definition list. Attributes: COMPACT Paired Required/Required
<DT> Gives a definition label (term) and is used within a DL statement. Paired Required/ Optional
<DD> This contains a definition list description used in a DL. Paired Required/Optional
Attributes:
Common to <LI>, <UL>, and <OL> tag. TYPE attribute decides a <OL TYPE="I" START= "3" COMPACT>
type of list. The values of type attribute for ordered list are: 1 <LI> CPU
TYPE (Arabic), i (Small case Roman), I (Upper case Roman), a (Small <LI> MONITOR
Alphabet), A (Upper case Alphabet). For unordered list, the values <LI VALUE=10> KEYBOARD
of TYPE attributes are: DISC, CIRCLE, and SQUARE. </OL>
<LI> Tag. It is used to make a particular list item have a certain <UL TYPE= "CIRCLE">
VALUE
number. <LI> RICE
Common to <UL>, <OL>, and <DL> tag. It allows the browser to <LI> SUGAR
COMPACT
show a compact list. <LI TYPE = "DISC"> TEA
START Allows you to establish the beginning of list’s number sequence. </UL>
Creating a Table
<TABLE> Creates a table structure within a web page. Paired Required/Required
Attributes:
ALIGN Decides the alignment of the table in the browser window
Draws an outline around table row and cell. By default tables have <HTML>
BORDER <BODY>
no borders.
Defines how wide your table will appear across the width of the <TABLE BORDER="7" ALIGN="Center"
WIDTH WIDTH="50%" BACKGROUND
screen.
BGCOLOR Specifies background color within all table cells in table. ="Paper.jpg" BORDERCOLOR="Blue"
3
Reference book for IT
Web Publishing
BACKGROUND Specifies the location of image as a background for table.
BORDERCOLOR Specifies color of the borders of all the table cells in table.
BORDERCOLORD Indicates the darker color used to form 3-D borders around the table
ARK cell. (only supported by IE)
BORDERCOLORLI Indicates the lighter color used to form 3-D borders around the table
GHT cell. (only supported by IE)
Decides the amount of spacing between each cell border and the CELLPADDING="20" CELLSPACING="30"
CELLPADDING BORDERCOLORDARK="Red"
actual content of cell.
BORDERCOLORLIGHT="Green"
CELLSPACING Creates space between the cells in a table.
RULES=All FRAMES=VSides>
FRAME Specifies external border lines around the table. <TR ALIGN=CENTER>
RULES Specifies where rule lines appear inside the table. <TD BGCOLOR=Red>Physics
<TD BGCOLOR=Blue>Chemistry
4
Reference book for IT
Web Publishing
Specifies the horizontal alignment of row or column to left right or
ALIGN <TABLE BORDER=1 WIDTH=150>
center. Default value is left.
<TR>
Specifies the vertical alignment of row or column to top, bottom or <TD ROWSPAN = 2 VALIGN=Top>
VALIGN
center. Computer Subjects
Disables the default word-wrapping within table cell, thus <TD> Information Technology
NOWRAP
maximizing the amount of the cells horizontal space. <TR>
COLSPAN Number of columns that a cell spans. <TD NOWRAP> Computer Science
ROWSPAN Number of rows that a cell spans. </TABLE>
Creating a Frames
<FRAMESET> Creates a frame i.e. splits the window into two or more spans. Paired Required/Required
Attributes:
Specifies how many rows the frameset needs to be split in and
ROWS
what should be the size of each. <FRAMESET ROWS = '200,500,*'
Specifies how many cols the frameset needs to be split in and what BORDER=3 BORDERCOLOR=Green
COLS FRAMESPACING=30>
should be the size of each.
Specifies the thickness of borders (in pixel) around frames defined
BORDER <FRAMESET COLS = '50%,*'
within the frameset.
BORDERLOLOR Sets the color of the frame borders. BORDER=3 BORDERCOLOR=Green
FRAMESPACING=30>
FRAMESPACING Specifies the space between frames within the browser window.
<IFRAME> Creates an inline or floating frame within a document. (Mar-2004) Paired Required/Required
Attributes:
SRC, ALIGN, NAME, HEIGHT, WIDTH, BORDER, BORDERCOLOR, FRAMEBORDER, FRAMESPACING, HSPACE, VSPACE,
5
Reference book for IT
Web Publishing
MARGINWIDTH, MARGINHEIGHT, NORESIZE, SCROLLING
Attributes:
Specifies the thickness of borders (in pixel) around frame or floating
BORDER
frame.
BORDERLOLOR Sets the color of the frame or floating frame borders. <FRAMESET COLS = '400,*'>
Specifies the space (in pixel) between adjacent frames or floating <FRAME SRC = "Intro.htm" NAME =
FRAMESPACING
frames. "Frame1" FRAMEBORDER=1
Specifies the location of a document that you want to load within MARGINHEIGHT=10 MARGINWIDTH=10
SRC
the defined frame. NORESIZE SCROLLING= No>
NAME Gives the frame you are defining a name.
<FRAME SRC = "Test.htm" NAME =
FRAMEBORDER Indicates whether the frame’s border is visible (1) or not (0). "2" FRAMEBORDER=0
Specifies the vertical dimension of the top and bottom margin in a MARGINHEIGHT=10 MARGINWIDTH=10
MARGINWIDTH
frame. NORESIZE SCROLLING= No>
Specifies the horizontal dimension of the left and right margin in a </FRAMESET>
MARGINHEIGHT
frame.
NORESIZE Makes the frame’s dimensions unchangeable.
<IFRAME SRC= "js.htm" ALIGN=Center
SCROLLING Indicates whether a scrollbar is present within a frame or not. FRAMEBORDER =1 BORDER=3
HEIGHT Specifies the vertical dimension of the floating frame. BODERCOLOR=Yellow HEIGHT= 500
WIDTH= 600 VSPACE= 30 HSPACE= 30
WIDTH Specifies the horizontal dimension of floating frame.
NORESIZE SCROLLING=Yes>
VSPACE Indicates size of top & bottom margins within frame.
HSPACE Specifies size of left & right margins within frame.
Allows the user to define alternative content where frames may not
<NOFRAMES> Paired Required/Required
be supported.
Designing a Forms
6
Reference book for IT
Web Publishing
<FORM> Creates a form in a web page, which takes user input. Paired Required/Required
Attributes:
NAME Assigns name to the form.
Gives the URL (Address) of the application that is to receive and <FORM NAME = "form1" METHOD = GET
ACTION
process the form’s data. (Mar-2005) ACTION = '/ProcessApplication.cgi'
Sets the method (GET or POST) by which the browser sends the TARGET = 'output'>
METHOD
form’s data to the server for processing. (Mar-2005)
TARGET Redirects the result of a form to another window or frame. <FORM METHOD=POST ACCEPT =
'image/gif, image/jpeg'>
Specifies list of MIME types, separated by commas, that server
ACCEPT
processing the form will handle correctly.
<INPUT> Used within a form to define controls for user input. (Mar-2005) Unpaired Required/Forbidden
Attributes:
NAME Assigns name to the form element. <INPUT TYPE=text NAME =T1
Indicates the type of form element. Valid types are TEXT (default), MAXLENGTH=20 SIZE=30 TABINDEX=5>
TYPE PASSWORD, RADIO, CHECKBOX, FILE, SUBMIT, RESET,
IMAGE, BUTTON, HIDDEN. <INPUT TYPE=text NAME =T2
VALUE Sets the default input value method. VALUE=Ranju READONLY>
ALIGN Line up a graphical submit button (TYPE=IMAGE).
<INPUT TYPE=password NAME =T3
Use with TYPE=RADIO or TYPE=CHECKBOX to set the default VALUE=Sonu NOTAB>
CHECKED
state of those elements to True.
Indicates the maximum number of characters you can enter into a <INPUT TYPE=checkbox NAME=T1
MAXLENGTH
TEXT or PASSWORD field. CHECKED>
NOTAB Removes the input element from the tab order.
<INPUT TYPE=file NAME =T2>
SIZE Specifies the width of TEXT or PASSWORD element.
SRC Specifies the location of image for SUBMIT button. <INPUT TYPE=image SRC= "p1.gif"
TABINDEX Specifies where the form element appears the tab order. ALIGN =right>
7
Reference book for IT
Web Publishing
READONLY Indicates that changes to form element data cannot occur.
MULTIPLE Indicates that a visitor can select more than one item at a same time. <SELECT NAME =DT1 DISABLED>
DISABLE Denies access to the selection list.
<TEXTAREA> Defines a multiple-line text input field within a form. Paired Required/Required
Attributes:
NAME Names the value you pass to the form processor. <TEXTAREA NAME=ta1 ROWS=5 COLS=25
ROWS Indicates the height (in lines of text) of the text input field. TABINDEX=2> </TEXTAREA>
COLS Indicates the width (in character width) of the text input field.
<TEXTAREA NAME=story READONLY>
READONLY Specifies that visitor cannot change the contents of text input field. Tikekar Road, Dhantoli</TEXTAREA>
TABINDEX Indicates where <TEXTAREA> appears in tabbing order.
8
Reference book for IT
Web Publishing
Image Mapping
<MAP> Defines a client-side image map. (Mar-2005,06) Paired Required/Required
Attributes:
Establish a name for map information you can later reference by the
NAME <MAP NAME=map1>
USEMAP attribute of the <IMG> tag.
9
Reference book for IT
Web Publishing
HSPACE Establish a margin of white space (in pixel) left and right image.
ALT Provides a textual description of image useful for visitors.
HEIGHT Specifies the vertical dimension of the image (in pixel).
WIDTH Specifies the horizontal dimension of the image (in pixel).
Specifies a name by which bookmarks, scripts, and applets can <IMG SRC="map1.gif" NAME="img_1"
NAME ALT="Image" USEMAP="#map2">
reference the image.
USEMAP Specifies the location of the client-side imagemap data.
<IMG SRC="main.gif" ISMAP>
Indicates that the graphical image functions as a clickable
ISMAP
imagemap.
10
Reference book for IT
Web Publishing
<PARAM> Supplies parameters for applets within <APPLET> tag Unpaired Required/Forbidden
Attributes:
NAME Indicates the name of the parameter passed to the embedded object.
<PARAM NAME=fgcolor VALUE =
Specifies the value associated with the parameter passed to the "ff00ff">
VALUE
embedded object.
Asks the browser to refer to the external style sheet for all
<LINK> Unpaired Required/Forbidden
formatting other styling elements.
Attributes:
Defines the relationship you are establishing between the current
REL
document and another resource.
TYPE Specifies the MIME type of style sheet to import with <LINK> tag. <LINK REL="STYLESHEET" TYPE=
Indicates the location of the resource you are establishing a "text/css" HREF= "/style/main.css"
HREF NAME="style">
relationship.
Specifies the name by which bookmarks, scripts and applets can
NAME
reference the relationship.
<EMBED> Includes video as well as variety of audio formats on a web page. Unpaired Required/Forbidden
11
Reference book for IT
Web Publishing
(Mar-2006)
Attributes:
Supplies the URL of the data object that you embed in the HTML
SRC document.
12
Reference book for IT
Web Publishing
<A> The anchor tag and is used to reference a hyperlink. Paired Required/Required
Attributes:
NAME Marks a location within the current document with a name.
Specifies the location of a file which you want to provide a <A NAME = "India">India</A>
HREF
hyperlink. (Mar-2004,2005) <A HREF= "#india">
Indicates the name of specific frame into which you load the linked
TARGET
document. <A SHAPE = RECT COORDS= "20,8,46,30"
SHAPE Specifies the type of shape used to represent the clickable area. HREF= "food.htm" TARGET= "page1">
COORDS Identifies the coordinates that define a clickable area.
13
Reference book for IT
Web Publishing
<HR> Displays horizontal lines (rules) in a web page. (Mar-2005) Unpaired Required/Forbidden
Attributes:
ALIGN Positions the line flush left, flush right, or in center of the document. <HR ALIGN = Center SIZE = 5 WIDTH = 50%
COLOR = Red NOSHADE>
SIZE Specifies the thickness of the line (in pixels).
WIDTH Specifies the length of the line in a document.
<HR ALIGN = Left SIZE = 6 WIDTH = 500
NOSHADE Specifies that the browser not shade the line.
COLOR = Blue>
COLOR Specifies the color of the line. (Mar-2005)
Scrolls the text over horizontal line on a web page. Only Internet
<MARQUEE> Paired Required/Required
Explorer recognizes this tag. (M-2005, 2006)
Attributes:
ALIGN Specifies the alignment of text outside the marquee. When BEHAVIOR = scroll, the text starts at one
BGCOLOR Specifies background color of the marquee. side of screen and disappears off the other.
HEIGHT Specifies the vertical dimension of the marquee. When BEHAVIOR = slide, the text starts at one
side of screen and stop when it reaches the other.
WIDTH Specifies the horizontal dimension of the marquee. (Mar-2005)
DIRECTION Indicates the direction in which the marquee text scrolls.
When BEHAVIOR = alternate, the text starts at
BEHAVIOR Determines the type of marquee as scroll, slide or alternate. one side of screen and bounces back when it
SCROLLAMOUNT Indicates how far (in pixel) the marquee text shifts between redraws. reaches the other. (Mar-2006)
SCROLLDELAY Indicates how often (in milliseconds) the marquee text redraws.
<MARQUEE ALIGN=Bottom LOOP=4
HSPACE Specifies the size of margins to the left and right of the marquee. GBCOLOR=Yellow DIRECTION=Left
VSPACE Specifies the size of margins at the top and bottom of the marquee. BEHAVIOR=alternate SCROLLDELAY= 150
SCROLLAMOUNT = 50 HEIGHT = 300>
LOOP Specifies the number of time of marquee to scroll. (Mar-2005) VIDYA NIKETAN</MARQUEE>
Attributes:
14
Reference book for IT
Web Publishing
Specifies the name of association you are defining, such as <META NAME = "Author" CONTENT = "Liz
NAME
keywords, Authors, or Description. Castro">
Gives user agents more contexts for interpreting the information in
SCHEME <META HTTP-EQUIV = "refresh" content
the content attribute.
= "5; URL = "I.mid">
CONTENT Assigns values to the HTTP header field.
<META NAME = "keywords" CONTENT =
Indicates the HTTP header value you want to define, such as "shop, shap, market, selling, celling,
HTTP-EQUIV
Refresh, Expires, or content-LANGUAGE. shopping, sold, purchase, sell">
15
Reference book for IT
Web Publishing
> > (greater than) ® ® (Registration)
& & (ampersand)
© © (Copy right)
® ® (Registration)
16