HTML and CSS Reference
In-Depth Information
his code references a directory on the web server rather than a single ile.
his is a request to the web server for the default index ile in that directory,
usually index.html. If the web server cannot ind a default index ile, it has the
option of returning an index listing of all iles in that directory. A URL begin-
ning with a single slash is a request to get a resource from the website's docu-
ment root. his is called root URL addressing . A single slash with no path or
ile information is a shorthand request for the website's home page:
<a href="/"> Enterprise Home </a>
Full URL addressing must be used if the ile or resource is on a diferent
server than the current ile. he protocol method and the server's hostname
must be speciied:
<a href=""> Spot </a>
Optional parameters can be sent to a web server resource by adding a ques-
tion mark (?) to the end of the URL with a list of name-value pairs separated
by ampersands (&) . Usually, the resource is a server-side script that knows
what to do with the parameters. For example, the following anchor element
could represent a link to a server-side script named show_log :
<a href="/officers/show_log?rank=captain&stardate=1512.2"> ... </a>
he show_log script has access to the information in the parameters and
knows that the request is for the captain's log, stardate 1512.2. It uses that
information to dynamically build a reply page to send back to the requesting
browser. he parameters are also available to client-side scripts embedded in
an HTML ile—even an HTML ile generated by a server script—so every URL
request has multiple dynamic possibilities.
he link created by an anchor or area element can be in one of four states: nor-
mal, hover, active, or visited. he normal state is a link that has not been vis-
ited by that browser in recent history. he active state occurs when the anchor
or area element has focus and has been “activated.” For standard PC brows-
ers this occurs when a mouse down event has been detected and the browser
is waiting for the user to release the button. A link is in the visited state if it
has been visited before in recent history. he length of time a link remains in
the visited state is a function of the browser's preference settings. Clearing a
browser's history resets the state of any visited links to normal.
Search WWH ::

Custom Search