Vous êtes sur la page 1sur 2

absolute url means complete url: for ex. <a href="http://www.sonyericsson.com/cws/index.html"></a> "http://www.sonyericsson.com/cws/index.

html" --- absolute url --------------------------------------------------------------------relative url means shorthand url. this url is relative to the page where the lin k is used. for ex. a directory structure : lets say www.sonyericsson.com is the root domain. it contains folders named movi e, art, music etc. The movie folder itself contains a file named movieindex.html and the music folder contains musicindex.html. if i want to give a reference to movieindex.html file from musicindex.html file i will write as: <a href="../movie/movieindex.html"></a> "../movie/movieindex.html" this is the shorthand notation for absolute url (http ://www.sonyericsson.com/movie/movieindex.html). N.B.:- Absolute url works only for referncing internal pages within a site or do main, not for urls outside present domain. 3 notations things to understand: 1) ../ means one level up. similar to our computer directory. 2) if the music directory contains another sub directory western and within west ern one file named westernmusic.html. Now if we want to give reference to westernmusic.html from musicindex.html fi le we will write it as: since musicindex.html file and western folder are at the same level we will writ e: <a href="western/westernmusic.html"></a> directly - western/westernmusic.html 3) forward slash (/) indicates root domain. if we want to reference any file which is in root domain or any part of the webs ite from some other page in some other directory ... and if we want start from r oot directory and move to the specific directory, simply start with forward slas h (/) and write the rest of the directory structure as follows: <a href="/Errorpages/cws/index.html"></a> , where Errorpages directory is in the

root domain. by putting / in beginning we have directly gone to the top level a nd from there give the desired directory structure.

Vous aimerez peut-être aussi