It is no exaggeration to say that it is the hyperlink that connects the entire Internet. Hyperlinks can point to almost any resource on the Internet, such as another webpage, a picture, an MP3 song, etc. The syntax for using XHTML to create hyperlinks is very simple, and only a pair of <a></a> tags are needed:
| <a href=The URL to which this hyperlink will point to>The text or picture to be displayed on the page, etc.</a> |
For example:
| <a href=http://www.CuoXIn.com/></a> |
It will appear as a hyperlink in the browser, click it and enter (http://www.CuoXIn.com/). The effects are as follows:
The href attribute in the <a> tag is the address that this hyperlink wants to point to. It can be a general URL or an email address. In the later practice example, we will create a hyperlink to the email address. The content (element) between <a> and </a> will be displayed on the webpage as a hyperlink. Pay attention to the fact that when the href attribute value is a general URL (absolute path), http:// cannot be omitted, otherwise the browser will identify it as a relative path. The difference between absolute paths and relative paths is not within the scope of this XHTML tutorial. If you don’t understand, you can search for relevant information on Baidu.
You may have paid attention to when browsing other websites. There are some hyperlinks that can bring you back to the top of the page or any location on the current page. Like the link below:
Back to title
Its implementation method is as follows, first add the following code to the title. :
| <h1>XHTML Introduction Learning Tutorial-XHTML Hyperlink<a id=biaoti></a></h1> |
The code of the hyperlink itself is:
| <a href=#biaoti>Back to title</a> |