Académique Documents
Professionnel Documents
Culture Documents
LANGUAGE REFERENCES
HyperText Markup Language (HTML) is a markup language designed for the creation of web pages with hypertext and
other information to be displayed in a web browser. HTML is used to structure information denoting certain text as
headings, paragraphs, lists and so on and can be used to describe, to some degree, the appearance and semantics of
a document. HTML's grammar structure is the HTML DTD that was created using SGML syntax.
Markup Language combines text and extra information about the text. The extra information, for example about the text's
structure or presentation, is expressed using markup, which is intermingled with the primary text. The best-known markup
language in modern use is HTML (HyperText Markup Language), one of the foundations of the World Wide Web.
Web page or webpage is a resource on the World Wide Web, usually in HTML/XHTML format with hypertext links to
enable navigation from one page or section to another. Varying filename extensions can be used, such as .htm, .html, or
.php to name a few. Web pages often use graphic files to provide illustration. A web page is displayed using a web
browser, which can have a Graphical User Interface, like Internet Explorer, Mozilla Firefox, or Opera, or can have a
Command Line Interface, like Lynx.
Hypertext is a user interface paradigm for displaying documents which, according to an early definition (Nelson 1970),
"branch or perform on request." The most frequently discussed form of hypertext document contains automated crossreferences to other documents called hyperlinks. Selecting a hyperlink causes the computer to display the linked
document within a very short period of time.
Web browser is a software application that enables a user to display and interact with text, images, and other information
typically located on a web page at a website on the World Wide Web or a local area network. Text and images on a web
page can contain hyperlinks to other web pages at the same or different websites. Web browsers allow a user to quickly
and easily access information provided on many web pages at many websites by traversing these links.
Uniform Resource Locator (URL) is a string of characters conforming to a standardized format, which refers to a
resource on the Internet (such as a document or an image) by its location. For example, the URL of this page on
Wikipedia is http://en.wikipedia.org/wiki/Uniform_Resource_Locator.
An HTTP URL, commonly called a web address, is usually shown in the address bar of a web browser.
Standard Generalized Markup Language (SGML) is a metalanguage in which one can define markup languages for
documents. SGML is a descendant of IBM's Generalized Markup Language (GML), developed in the 1960s by Charles
Goldfarb, Edward Mosher and Raymond Lorie (whose surname initials also happen to be GML). SGML should not be
confused with the Geography Markup Language (GML) developed by the Open GIS Consortium; cf, or the Game Maker
scripting language, GML.
BRIEF HISTORY
Tim Berners-Lee, who pioneered the use of hypertext for sharing information, created the first web browser, named
WorldWideWeb, in 1990 and introduced it to colleagues at CERN in March 1991. Since then the development of web
browsers has been inseparably intertwined with the development of the web itself.
The explosion in popularity of the web was triggered by NCSA Mosaic which was a graphical browser running originally on
Unix but soon ported to the Apple Macintosh and Microsoft Windows platforms. Version 1.0 was released in September
1993, and was dubbed the killer application of the Internet. Marc Andreessen, who was the leader of the Mosaic team at
NCSA, quit to form a company that would later be known as Netscape Communications Corporation.
NCSA Mosaic was originally designed and programmed for Unix's X Window System by Marc Andreessen and Eric Bina
at NCSA. Development of Mosaic began in December 1992. Version 1.0 was released on April 22, 1993, followed by two
maintenance releases during summer 1993
HTML element indicates structure in an HTML document. More specifically, it is an SGML element that meets the
requirements of one or more of the HTML Document Type Definitions (DTDs). HTML elements generally consist of three
parts: a start tag marking the beginning of an element, some amount of content, and an end tag. Elements may represent
headings, paragraphs, hypertext links, lists, embedded media, and a variety of other structures.
Many HTML elements include attributes in their start tags, defining desired behavior. The end tag is optional for many
elements; in a minimal case, an empty element has no content or end tag. There are a few elements that are not part of
any official DTDs, yet are supported by some browsers and used by some web pages. Such elements may be ignored or
displayed improperly on browsers not supporting them. Informally, HTML elements are sometimes referred to as "tags"
(an example of synecdoche), though many prefer the term tag strictly in reference to the semantic structures delimiting the
start and end of an element.
HTML Basic Structure
HTML THE FIRST AND LAST TAGS IN A DOCUMENT SHOULD ALWAYS BE THE HTML TAGS. THESE ARE THE
TAGS THAT TELL A WEB BROWSER WHERE THE HTML IN YOUR DOCUMENT BEGINS AND ENDS. THE
ABSOLUTE MOST BASIC OF ALL POSSIBLE WEB DOCUMENTS IS: <HTML>
</HTML>
HEAD. THE HEAD TAGS CONTAIN ALL OF THE DOCUMENT'S HEADER INFORMATION. WHEN I SAY "HEADER," I
DON'T MEAN WHAT APPEARS AT THE TOP OF THE BROWSER WINDOW, BUT THINGS LIKE THE
DOCUMENT TITLE AND SO ON. SPEAKING OF WHICH...
TITLE. THIS CONTAINER IS PLACED WITHIN THE HEAD STRUCTURE. BETWEEN THE TITLE TAGS, YOU SHOULD
HAVE THE TITLE OF YOUR DOCUMENT. THIS WILL APPEAR AT THE TOP OF THE BROWSER'S TITLE BAR,
AND ALSO APPEARS IN THE HISTORY LIST. FINALLY, THE CONTENTS OF THE TITLE CONTAINER GO
INTO YOUR BOOKMARK FILE, IF YOU CREATE A BOOKMARK TO A PAGE.
BODY. BODY COMES AFTER THE HEAD STRUCTURE. BETWEEN THE BODY TAGS, YOU FIND ALL OF THE STUFF
THAT GETS DISPLAYED IN THE BROWSER WINDOW. ALL OF THE TEXT, THE GRAPHICS, AND LINKS, AND
SO ON -- THESE THINGS OCCUR BETWEEN THE BODY TAGS. WE'LL GET TO WHAT HAPPENS THERE
STARTING WITH THE NEXT CHAPTER.
So, putting everything we've covered thus far into one file, we have:
<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
Basic Tags
Headings
Headings are defined with the <h1> to <h6> tags. <h1> defines the largest heading. <h6> defines the smallest
heading.
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h4>This is a heading</h4>
<h5>This is a heading</h5>
<h6>This is a heading</h6>
HTML automatically adds an extra blank line before and after a heading.
Paragraphs
Paragraphs are defined with the <p> tag.
<p>This is a paragraph</p>
<p>This is another paragraph</p>
HTML automatically adds an extra blank line before and after a paragraph.
Line Breaks
The <br> tag is used when you want to end a line, but don't want to start a new paragraph. The <br> tag forces a line
break wherever you place it.
<p>This <br> is a para<br>graph with line breaks</p>
The <br> tag is an empty tag. It has no closing tag.
Comment Tags
If you want to leave yourself notes in an HTML document, but don't want those notes to show up in the browser
window, you need to use the comment tag. To do that, you would do the following:
<!-- Hi, I'm a comment. -->
Your note would go where the text Hi, I'm a comment. appears. Yes, you do need an exclamation point after the
opening bracket, but not before the closing bracket. That's the way the standard is written
Text Formatting Tags
Tag
Description
<b>
<big>
<em>
<i>
<small>
<strong>
<sub>
<sup>
<ins>
<del>
<s>
<strike>
<u>
Description
Entity Name
Entity Number
non-breaking space
 
<
less than
<
<
>
greater than
>
>
&
ampersand
&
&
"
quotation mark
"
"
'
apostrophe
'
Description
Entity Name
Entity Number
cent
¢
¢
pound
£
£
yen
¥
¥
section
§
§
copyright
©
©
registered trademark
®
®
multiplication
×
×
division
÷
÷
Font Attributes
Attribute
Example
Purpose
Size="number"
size="2"
Size="+number"
size="+1"
size="-number"
size="-1"
face="face-name"
face="Times"
color="color-value"
color="#eeff00"
color="color-name"
color="red"
The <font> tag is deprecated in the latest versions of HTML (HTML 4 and XHTML).
The World Wide Web Consortium (W3C) has removed the <font> tag from its recommendations. In future versions of
HTML, style sheets (CSS) will be used to define the layout and display properties of HTML elements.
The Image Tag and the Src Attribute
In HTML, images are defined with the <img> tag.
The <img> tag is empty, which means that it contains attributes only and it has no closing tag.
To display an image on a page, you need to use the src attribute. Src stands for "source". The value of the src
attribute is the URL of the image you want to display on your page.
The syntax of defining an image:
<img src="url">
The URL points to the location where the image is stored. An image named "boat.gif" located in the directory "images"
on "www.w3schools.com" has the URL: http://www.w3schools.com/images/boat.gif.
The browser puts the image where the image tag occurs in the document. If you put an image tag between two
paragraphs, the browser shows the first paragraph, then the image, and then the second paragraph.
The Alt Attribute
The alt attribute is used to define an "alternate text" for an image. The value of the alt attribute is an author-defined
text:
The "alt" attribute tells the reader what he or she is missing on a page if the browser can't load images. The browser
will then display the alternate text instead of the image. It is a good practice to include the "alt" attribute for each image on
a page, to improve the display and usefulness of your document for people who have text-only browsers.
Backgrounds
The <body> tag has two attributes where you can specify backgrounds. The background can be a color or an image.
Bgcolor
The bgcolor attribute specifies a background-color for an HTML page. The value of this attribute can be a
hexadecimal number, an RGB value, or a color name:
<body bgcolor="#000000">
<body bgcolor="rgb(0,0,0)">
<body bgcolor="black">
Background
The background attribute specifies a background-image for an HTML page. The value of this attribute is the URL of
the image you want to use. If the image is smaller than the browser window, the image will repeat itself until it fills the
entire browser window.
<body background="clouds.gif">
<body background="http://www.w3schools.com/clouds.gif">
The URL can be relative (as in the first line above) or absolute (as in the second line above).
Note: If you want to use a background image, you should keep in mind:
Will the background image increase the loading time too much?
Will the background image look good with other images on the page?
Will the background image look good with the text colors on the page?
Will the background image look good when it is repeated on the page?
Will the background image take away the focus from the text?
Basic Notes - Useful Tips
The bgcolor, background, and the text attributes in the <body> tag are deprecated in the latest versions of HTML
(HTML 4 and XHTML). The World Wide Web Consortium (W3C) has removed these attributes from its recommendations.
Style sheets (CSS) should be used instead (to define the layout and display properties of HTML elements).
The Anchor Tag and the Href Attribute
HTML uses the <a> (anchor) tag to create a link to another document.
An anchor can point to any resource on the Web: an HTML page, an image, a sound file, a movie, etc.
The syntax of creating an anchor:
Unordered Lists
An unordered list is a list of items. The list items are marked with bullets (typically small black circles). An unordered list
starts with the <ul> tag. Each list item starts with the <li> tag.
<ul>
<li>Coffee</li>
<li>Milk</li>
</ul>
Ordered Lists
An ordered list is also a list of items. The list items are marked with numbers. An ordered list starts with the <ol> tag.
Each list item starts with the <li> tag.
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>
Inside a list item you can put paragraphs, line breaks, images, links, other lists, etc.
Definition Lists
A definition list is not a list of items. This is a list of terms and explanation of the terms. A definition list starts with the <dl>
tag. Each definition-list term starts with the <dt> tag. Each definition-list definition starts with the <dd> tag.
<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
Inside a definition-list definition (the <dd> tag) you can put paragraphs, line breaks, images, links, other lists, etc.
List Tags
Tag
Description
<ol>
<ul>
<li>
<dl>
<dt>
<dd>
Tables
Tables are defined with the <table> tag. A table is divided into rows (with the <tr> tag), and each row is divided into data
cells (with the <td> tag). The letters td stands for "table data," which is the content of a data cell. A data cell can contain
text, images, lists, paragraphs, forms, horizontal rules, tables, etc.
<table border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
Another Heading
Note that the borders around the empty table cell are missing (NB! Mozilla Firefox displays the border).
To avoid this, add a non-breaking space ( ) to empty data cells, to make the borders visible:
<table border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td> </td>
</tr>
</table>
Description
10
<table>
Defines a table
<th>
<tr>
<td>
Column 1
Row 1 Cell 1
Column 2
Column 3
Row 3 Cell 1
11
ACTION attribute contains the URL of the CGI program which processes the data sent by the browser. In the example
above, the program (program1) resides in the cgi-bin directory of the server which contains the form itself. The value of
ACTION can be either a relative or a full URL.
Any tag which is allowed inside of the <BODY> container is allowed inside a form. Headings, paragraphs, lists, tables,
images, links-- anything and everything goes. In addition, there are certain tags which are allowed to exist inside a form,
and nowhere else.
A form is an area that can contain form elements.
Form elements are elements that allow the user to enter information (like text fields, textarea fields, drop-down menus,
radio buttons, checkboxes, etc.) in a form.
A form is defined with the <form> tag.
<form>
<input>
<input>
</form>
Input Objects
The most used form tag is the <input> tag. The type of input is specified with the type attribute. The most commonly
used input types are explained below.
Text Fields
Text fields are used when you want the user to type letters, numbers, etc. in a form.
<form>
First name:
<input type="text" name="firstname">
<br>
Last name:
<input type="text" name="lastname">
</form>
Radio Buttons
Radio Buttons are used when you want the user to select one of a limited number of choices.
<form>
<input type="radio" name="sex" value="male"> Male
<br>
<input type="radio" name="sex" value="female"> Female
</form>
Checkboxes
Checkboxes are used when you want the user to select one or more options of a limited number of choices.
<form>
<input type="checkbox" name="bike">
I have a bike
<br>
<input type="checkbox" name="car">
I have a car
</form>
The Form's Action Attribute and the Submit Button
When the user clicks on the "Submit" button, the content of the form is sent to another file. The form's action attribute
defines the name of the file to send the content to. The file defined in the action attribute usually does something with the
received input.
<form name="input" action="html_form_action.asp" method="get">
Username: <input type="text" name="user">
<input type="submit" value="Submit">
</form>
12
Textarea Object
Defines a text-area (a multi-line text input control). A user can write text in the text-area. In a text-area you can write
an unlimited number of characters. The default font in the text-area is fixed pitch.
Source
Output
Value
Description
DTD
cols
number
STF
rows
number
STF
Optional Attributes
Attribute
Value
Description
DTD
disabled
disabled
STF
name
name_of_textarea
STF
readonly
readonly
Indicates that the user cannot modify the content in the text-area
Select Object
The select element creates a drop-down list. Tip: Use this tag in the form element to accept user input.
Example
Source
Output
<select>
<option value ="volvo">Volvo</option>
<option value ="saab">Saab</option>
<option value ="opel">Opel</option>
<option value ="audi">Audi</option>
</select>
Optional Attributes
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
Attribute
Value
Description
DTD
disabled
disabled
STF
multiple
multiple
When set, it specifies that multiple items can be selected at a time STF
name
unique_name
STF
size
number
STF
13
The text type input tag specifies a single line text entry field within the form that contains it.
The NAME attribute is a required field and is used to identify the data for the field.
The MAXLENGTH attribute specifies the number of characters that can be entered into this field.
The SIZE attribute specifies the amount of display space this field should take up.
The default for SIZE will vary by browser.
The VALUE attribute specifies the initial value of the field.
Form Input Check Box :<INPUT TYPE=CHECKBOX NAME=name VALUE=value CHECKED >
The checkbox type input tag specifies a Boolean choice within the form that contains it. If more than one checkbox
appears in the form with the same name the user can select none, one or several of the choices.
The NAME attribute is a required field and is used to identify the data for the field.
The VALUE attribute specifies the value that is returned if the box is checked. If the CHECKED attribute is specified, the
box is initially selected.
Form Input Radio Button
The radio button type input tag allows a choice among a number of options. Normally more than one radio button will
appear in the form with the same name. The user can then select only one of the of the choices.
14
The NAME attribute is a required field and is used to identify the data for the field. If one of the choices has the CHECKED
attribute it will initially be selected. If none of the choices has the CHECKED attribute then the first one defaults as initially
selected. The VALUE attribute specifies the value that is returned if the box is checked.
Form Input File :
<INPUT TYPE=FILE NAME=name ACCEPT=mime type list>
The file type input tag allows the user to attach one or more files to the form for submission.
The NAME attribute is a required field and is used to identify the data for the field.
The ACCEPT attribute is a list of mime types that will be accepted. (e.g. "image/*" or "image/gif, image/jpeg").
Form Input Password :
<INPUT TYPE=PASSWORD NAME=name MAXLENGTH=length SIZE=size VALUE=value >
The password type input tag specifies a single line text entry field within the form that contains it. The value entered by the
user will be obscured as it is entered.
The NAME attribute is a required field and is used to identify the data for the field.
The MAXLENGTH attribute specifies the number of characters that can be entered into this field. If MAXLENGTH is not
specified then there is no limit on the number of characters entered. If MAXLENGTH is longer than SIZE then the text field
will scroll appropriately.
The SIZE attribute specifies the amount of display space this field should take up. The default for SIZE will vary by
browser.
The VALUE attribute specifies the initial value of the field.
Form Input Reset
:
<INPUT TYPE=RESET>
The reset type input tag specifies a button. When the user clicks the button, all the fields in the form are reset to their
initial values.
Form Input Submit
The submit type input tag specifies a button. When the user clicks the button, the form is submitted.
The NAME attribute is used to identify the data for the field.
If no NAME attribute is given then this element does not form part of the submitted response.
The VALUE attribute specifies the label for the button.
Form Select
<SELECT NAME=name MULTIPLE SIZE=size > option entries </SELECT>
<OPTION> content
<OPTION SELECTED> content
<OPTION VALUE=value> content
<OPTION SHAPE=shape>
The select tag specifies a multiple line selection box field within the form that contains it. The user can select one or more
lines if the attribute MULTIPLE is specified. The NAME attribute is a required field and is used to identify the data for the
field.
The SIZE attribute specifies the number of lines of selections that are to be displayed.
The SELECTED attribute of the option tag specifies that the option is to be initially selected.
The VALUE attribute specifies the value to be returned if this option is selected.
If the VALUE attribute is not specified the content of the option is used.
Form Text Area
<TEXTAREA NAME=name COLS=# columns ROWS=# rows> content </TEXTAREA>
The text area tag specifies a multiple line text area field within the form that contains it.
The NAME attribute is a required field and is used to identify the data for the field.
The COLS attribute specifies the width in characters of the text area.
The ROWS attribute specifies the number of lines the text area contains.
The content is used as an initial value for the field. The field can be scrolled beyond the COLS and ROWS size to allow for
larger amounts of text to be entered.
15
FRAMES - SYNTAX
Frames are generated by three things: FRAMESET tags, FRAME tags, and Frame Documents.
FRAME DOCUMENT
A Frame Document has a basic structure very much like your normal HTML document, except the BODY container is
replaced by a FRAMESET container which describes the sub-HTML documents, or Frames, that will make up the page.
<HTML>
<HEAD>
</HEAD>
<FRAMESET>
</FRAMESET>
</HTML>
FRAME SYNTAX
Frame syntax is similar in scope and complexity to that used by tables, and has been designed to be quickly
processed by Internet client layout engines.
<FRAMESET>
This is the main container for a Frame. It has 2 attributes ROWS and COLS. A frame document has no BODY,
and no tags that would normally be placed in the BODY can appear before the FRAMESET tag, or the
FRAMESET will be ignored. The FRAMESET tag has a matching end tag, and within the FRAMESET you can
only have other nested FRAMESET tags, FRAME tags, or the NOFRAMES tag.
ROWS="row_height_value_list"
The ROWS attribute takes as its value a comma separated list of values. These values can be absolute pixel
values, percentage values between 1 and 100, or relative scaling values. The number of rows is implicit in the
number of elements in the list. Since the total height of all the rows must equal the height of the window, row
heights might be normalized to achieve this. A missing ROWS attribute is interpreted as a single row arbitrarily
sized to fit.
Syntax of value list.
value
A simple numeric value is assumed to be a fixed size in pixels. This is the most dangerous type of value to use
since the size of the viewer's window can and does vary substantially. If fixed pixel values are used, it will almost
certainly be necessary to mix them with one or more of the relative size values described below. Otherwise the
client engine will likely override your specified pixel value to ensure that the total proportions of the frame are
100% of the width and height of the user's window.
value%
This is a simple percentage value between 1 and 100. If the total is greater than 100 all percentages are scaled
down. If the total is less than 100, and relative-sized frames exist, extra space will be given to them. If there are
no relative-sized frames, all percentages will be scaled up to match a total of 100%.
value*
The value on this field is optional. A single '*' character is a "relative-sized" frame and is interpreted as a request
to give the frame all remaining space. If there exist multiple relative-sized frames, the remaining space is divided
16
evenly among them. If there is a value in front of the '*', that frame gets that much more relative space. "2*,*"
would give 2/3 of the space to the first frame, and 1/3 to the second.
Example for 3 rows, the first and the last being smaller than the center row:
<FRAMESET ROWS="20%,60%,20%">
Example for 3 rows, the first and the last being fixed height, with the remaining space assigned to the middle row:
<FRAMESET ROWS="100,*,100">
COLS="column_width_list"
The COLS attribute takes as its value a comma separated list of values that is of the exact same syntax as the list
described above for the ROWS attribute.
The FRAMESET tag can be nested inside other FRAMESET tags. In this case the complete subframe is placed in the
space that would be used for the corresponding frame if this had been a FRAME tag instead of a nested FRAMESET.
<FRAME>
This tag defines a single frame in a frameset. It has 6 possible attributes: SRC, NAME, MARGINWIDTH,
MARGINHEIGHT, SCROLLING, and NORESIZE. The FRAME tag is not a container so it has no matching end
tag.
SRC="url"
The SRC attribute takes as its value the URL of the document to be displayed in this particular frame. FRAMEs
without SRC attributes are displayed as a blank space the size the frame would have been.
NAME="window_name"
The NAME attribute is used to assign a name to a frame so it can be targeted by links in other documents (These
are usually from other frames in the same document.) The NAME attribute is optional; by default all windows are
unnamed.
Names must begin with an alphanumeric character.
Named frames can have their window contents targeted with the new TARGET attribute.
MARGINWIDTH="value"
The MARGINWIDTH attribute is used when the document author wants some control of the margins for this
frame. If specified, the value for MARGINWIDTH is in pixels. Margins can not be less than one-so that frame
objects will not touch frame edges-and can not be specified so that there is no space for the document contents.
The MARGINWIDTH attribute is optional; by default, all frames default to letting the browser decide on an
appropriate margin width.
MARGINHEIGHT="value"
The MARGINHEIGHT attribute is just like MARGINWIDTH above, except it controls the upper an lower margins
instead of the left and right margins.
SCROLLING="yes|no|auto"
The SCROLLING attribute is used to describe if the frame should have a scrollbar or not. Yes results in scrollbars
always being visible on that frame. No results in scrollbars never being visible. Auto instructs the browser to
decide whether scrollbars are needed, and place them where necessary. The SCROLLING attribute is optional;
the default value is auto.
NORESIZE
The NORESIZE attribute has no value. It is a flag that indicates that the frame is not resizable by the user. Users
typically resize frames by draggin a frame edge to a new position. Note that if any frame adjacent to an edge is
not resizable, that entire edge will be restricted from moving. This will effect the resizability of other frames.The
NORESIZE attribute is optional; by default all frames are resizable.
<NOFRAMES>
This tag is for content providers who want to create alternative content that is viewable by non-Frame-capable
clients. A Frame-capable Internet client ignores all tags and data between start and end NOFRAMES tags.
17