HTML Links

There are two kinds of link in HTML:
- Link In Page
- Link Out Page

  • Link In Page  or called Anchor  
Syntax
    --------- Click to Link ------------
    <a href = "# Anchor Name" > Label </a >
    ------------ Location ---------------
    <a aame = "Anchor Name" >


    Example
    <html>
    <head>
    <title> Demo Anchor </title>
    </head>
    <body>
    <a href = “#aa“> Down </a>
    -------------------------------
    ------------------------------- Text
    -------------------------------
    <a Name = “aa “ >
    --------------------------------
    -------------------------------- Text
    --------------------------------

    </a>
    </body>
    </html>

      •  Link Out Page  use to link from a page to a page or whole image to the page by using Label
       Syntax
         ------------- Open New Page by in the same page ---------
        <a href=“url” > Label < /a>


        ------------ Or Image Link -----------------
        <a href=“url”><img src=”PictureName.extension”\></a>


        --------------
        Open New Page by in other page ----------
        <a href=“url ” target =….. > Label </a>


        -------------------Link Page on position ---------------------
        <a href=“url #LabelName“ > Label < /a >


        Example
        <html>
        <head>
        <title> Demo Link in Page </title>
        </head>
        <body>

        -------------------------------
        ------------------------------- Text
        -------------------------------

         <a href = “page2.html“> Click Here </a>

        -------------------------------
        ------------------------------- Text
        -------------------------------

         <a href = “picture1.jpg“> View Image </a>
        </body>
        </html>

        • Link Out Page (Map Link)  use to link from a page to a page or whole image to the page by using Map
         Syntax
         
        * Set Image :
        <img src = “ ..... “ UseMap = “#MapName “/>

        * Set Map :
        <map name = “MapName” >

        * Set Coordinator :
        <Area Shape = “Rect or Circle or Poly “
        Coords = “ ......... “
        href = “ url “

        Notice shape "Rect or Circle or Poly"

        Rect: Coords = “x1,y1,x2,y2“ Diagonal dotted rectangle at the beginning and end
        Circle: Coords = “center (x , y) , ( r ) ”
        Poly: Coodrds = “x1,y1,x2,y2,x3,y3,x4,y4,x5,y5”

        Example
        <HTML>
        <Body>
        <Center>
        <H1> This is my country . </H1>
        <IMG SRC = “ Cambodia.jpg “
        Usemap = “#abc“
        Border = “0 “ >
        <Map Name = “abc“ >
        <Area Shape = “Rect “
        Coords = “150 , 78 , 186 , 86 “
        HREF = “ Page1.html “ />
        <Area Shape = “Circle “
        Coords = “421 , 360 , 10 “
        href = “ Page2.html “ />
        <Area Shape = “Poly “
        Coords = “208 , 202 , 203 , 201 , 193 , ....”
        href = “Page3.html”/>
        </Map>
        </Center>
        </Body>
        </HTML>