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, and so on. The syntax for using xhtml to create hyperlinks is very simple, and only a pair of <a></a> tags are needed:
For example:
It will be displayed as a hyperlink in the browser. Clicking it will enter the web teaching website (http://www.VeVb.com/). The effects are as follows:
Web teaching website
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. Note that when the href attribute value is a general URL (absolute path), its http:// cannot be omitted, otherwise the browser will use it as a relative path to identify it. 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 noticed when browsing other websites that 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. :
The code of the hyperlink itself is:
When there is a large amount of content in your page, your users can quickly find the information they need. Usually, it is used as a directory in some explanatory web pages.
The following exercises to add hyperlinks to the previous index.html. Open index.html and modify the code as follows:
After saving, browse your own web page. Please confirm that your web page is the same as this page. Click the newly created link. If you install email management software such as outlook, you will open an interface to send emails to yourself.