Page 163 - Web Applications (803) Class 11
P. 163

Internal Linking
                 An HTML internal link connects two pages on the same website. This link might be either absolute or relative. The hash
                 sign (#) follows the name of an HTML internal link. To refer to a section of your page, which is referred to as an internal
                 link to the same page, you must assign an id. When you click on an internal anchor link, your browser will automatically
                 scroll to the specified part and display it.
                 Syntax:

                 <a name= "#Text" ></a>              or   <a id="#Text" ></a>
                 <a href="#Text"></a>
                 Example:

                 <!DOCTYPE html>
                 <html>
                 <head>
                 <title>Internal Link</title>

                 </head>
                 <body>
                 <h1 id="top">Links to Sections of The Same Page</h1>
                 <p>

                        ------lots of text to fill the whole page---------
                        ------------------------------------------------------
                        ------------------------------------------------------
                 </p>

                 <a href="#top">Back to Top of Page</a>
                 </body>
                 </html>






















                 External Linking

                 To connect two html webpages, an external link is utilised. External links are formed when you want to go to another
                 page or URL by clicking on a link on a webpage. The anchor tag in html is used to create an external link.
                 Syntax:

                 <a href= "Pagename.html or URL"> text visible on link </a>


                                                                            Website Development using HTML and CSS   161
   158   159   160   161   162   163   164   165   166   167   168