Introduction to HTML method of opening link files using hyperlinks

Introduction to HTML method of opening link files using hyperlinks

a and href attributes HTML uses <a> to represent hyperlinks, which are called anchors in English.
<a> can point to any file source: an HTML page, a picture, a video file, etc. Usage is as follows:
<ahref="url">Link display text</a> Click the content in <a></a> to open a link file, and the href attribute indicates the path of the link file.
For example, if you link to the homepage of jb51.net, you can express it like this:
<ahref="https://www.jb51.net">Dotte Software Station jb51.net Home Page</a>target attribute Using the target attribute, you can open the link file in a new window.
<ahref="https://www.jb51.net"target=_blank>Dotte Software Station jb51.net Home Page</a>
title attribute Using the title attribute, you can display the text annotation of the hyperlink when the mouse hovers over the hyperlink.
<ahref="https://www.jb51.net"title="Dotte Software Station Web Tutorial and Code Chinese Site">Dotte Software Station Website</a>If you want the comment to display on multiple lines, you can use as a line break.
<ahref="https://www.jb51.net"title="Dotte Software Station Web Tutorial and Code Chinese Site">Dotte Software Station Website</a>
name attribute Using the name attribute, you can jump to a specified part of a file.
To use the name attribute, set a pair. One is to set the name of the name, and the other is to set an href pointing to the name:
<ahref="#C1">See Chapter 1</a><aname="C1">Chapter 1</a>
The name attribute is often used to create a table of contents for a large document. A link is created for each chapter and placed at the beginning of the file, and the Name attribute is set at the beginning of each chapter. When a user clicks on a link to a chapter, the content of that chapter is displayed at the top.
If the browser cannot find the part specified by Name, it will display the beginning of the article without reporting an error.
Link to email address On the website, you will often see a "Contact Us" link. Once you click this link, it will trigger your email client, such as Outlook Express, and then display a new email window. This function can be achieved using <a>.
<ahref="mailto:[email protected]">Contact Sina</a>

<<:  5 solutions to CSS box collapse

>>:  jenkins+gitlab+nginx deployment of front-end application

Recommend

Vue uses three methods to refresh the page

When we are writing projects, we often encounter ...

Vue-CLI3.x automatically deploys projects to the server

Table of contents Preface 1. Install scp2 2. Conf...

Three ways to implement waterfall flow layout

Preface When I was browsing Xianyu today, I notic...

Tutorial on installing Odoo14 from source code on Ubuntu 18.04

Table of contents Background of this series Overv...

How to implement CSS mask full screen center alignment

The specific code is as follows: <style> #t...

Detailed explanation of Linux zabbix agent deployment and configuration methods

1. Install zabbix-agent on web01 Deploy zabbix wa...

Detailed tutorial on installing Anaconda3 on Ubuntu 18.04

Anaconda refers to an open source Python distribu...

Understanding Nginx Current Limitation in One Article (Simple Implementation)

Nginx is now one of the most popular load balance...

Nest.js hashing and encryption example detailed explanation

0x0 Introduction First of all, what is a hash alg...

Detailed explanation of Linux mpstat command usage

1. mpstat command 1.1 Command Format mpstat [ -A ...

How to capture exceptions gracefully in React

Table of contents Preface ErrorBoundary Beyond Er...