HTML link
I believe everyone is familiar with hyperlinks. I don’t know how many I click on every day. A hyperlink can be a word, a word, a group of words, or an image. You can click on these contents to jump to a new document or a certain part of the current document. In the previous example, we simply used the < a> tag, used characters as hyperlinks on the Internet, and also used < a> to implement the function of sending emails. What we are going to talk about below are all about the attributes of the < a> tag
We will explain HTML links in detail:
1. Add a hyperlink to the text
First of all, let’s review the simplest link usage, which is to directly add links to text to web pages and other HTML files.
HTML content is as follows
<html> <body> <p>let's have an example</p> <p> <a href="http://www.php.cn">php中文网</a> </p> </body> </html>
This is a screenshot of myself in the environment:
This is the simplest hyperlink, next Let's link this HTML file to another HTML file. (In the same folder, add another HTMl file), and then the following is the HTML content and results
After clicking in (the content of the other HTML will no longer be displayed) :
2. Add a link to the picture
This It is a screenshot of the content and results:
After clicking on the picture, the link is successful: