XHTML Getting Started Tutorial: XHTML Hyperlinks

XHTML Getting Started Tutorial: XHTML Hyperlinks
It is no exaggeration to say that hyperlinks connect the entire Internet. A hyperlink can point to almost any resource on the Internet, such as another web page, a picture, an MP3 song, etc. The syntax for creating a hyperlink using XHTML is very simple, requiring only a pair of <a></a> tags:
<a href="URL that this hyperlink will point to">Text or image that will be displayed on the page</a>
For example:
<a href="https://www.jb51.net/">123WORDPRESS.COM</a>
It will be displayed as a hyperlink in the browser, and clicking it will take you to 123WORDPRESS.COM (https://www.jb51.net/). The effect is as follows:
123WORDPRESS.COM
The href attribute in the <a> tag is the address that the hyperlink points to. It can be a general URL or an email address. In a later practice example, we will create a hyperlink pointing to an email address. The content (elements) between <a> and </a> will be displayed as a hyperlink on the web page. Note that when the href attribute value is a general URL (absolute path), the "http://" cannot be omitted, otherwise the browser will recognize it as a relative path. The difference between absolute paths and relative paths is beyond the scope of this XHTML tutorial. If you don't understand, you can search for relevant information on Baidu. Hyperlinks (anchors) to jump to within a page
When you browse other websites, you may have noticed that there are some hyperlinks that allow you to return to the top of the page or to any other location within the current page. Like the link below:
Back to the title <br />The implementation method is as follows. First, add the following code to the title. :
<h1>XHTML Beginner's Guide - XHTML Hyperlinks<a id="biaoti"></a></h1>
The code for the hyperlink itself is:
<a href="#biaoti">Back to title</a>
Page jumps allow your users to quickly find the information they need when there is a large amount of content on your page. Usually it is used as a directory in some explanatory web pages. Link Exercise The following exercise adds a hyperlink to the previous "index.html". Open "index.html" and modify the code as follows:
<html>
The intermediate code is omitted...
<p><a href="mailto:[email protected]">Contact me</a></p><!-- Note that you need to change the email address to your own-->
<p>Copyright&copy;2005-2006XXX Copyright No</p>
</body>
</html>
After saving, browse your own web page and make sure that your web page is the same as this page. Click on the newly created link. If you have installed email management software such as Outlook, an interface for sending emails to yourself will open.

<<:  Detailed explanation of MYSQL character set setting method (terminal character set)

>>:  Detailed explanation of the process of creating floor navigation effects with JavaScript

Recommend

Mysql keeps the existing content and adds content later

This command modifies the data table ff_vod and a...

Some tips on deep optimization to improve website access speed

<br />The website access speed can directly ...

Use href in html to pop up a file download dialog box when clicking a link

I learned a new trick today. I didn’t know it befo...

Pure CSS to achieve click to expand and read the full text function

Note When developing an article display list inte...

How to build Git service based on http protocol on VMware+centOS 8

Table of contents 1. Cause 2. Equipment Informati...

Docker-compose quickly builds steps for Docker private warehouse

Create docker-compose.yml and fill in the followi...

Detailed explanation of JSON.parse and JSON.stringify usage

Table of contents JSON.parse JSON.parse Syntax re...

Example of how to mosaic an image using js

This article mainly introduces an example of how ...

react-beautiful-dnd implements component drag and drop function

Table of contents 1. Installation 2.APi 3. react-...

Install nodejs and yarn and configure Taobao source process record

Table of contents 1. Download nodejs 2. Double-cl...

How to use axios request in Vue project

Table of contents 1. Installation 2. There is no ...

10 excellent Web UI libraries/frameworks

1. IT Mill Toolkit IT Mill Toolkit is an open sou...

How to add a paging navigation bar to the page through Element UI

need Add a paging bar, which can jump to the page...

Things to note when writing self-closing XHTML tags

The img tag in XHTML should be written like this:...

Install Tomcat on Linux system and configure Service startup and shutdown

Configure service startup and shutdown in Linux s...