Detailed explanation of what html anchors are

PHPz
Release: 2017-04-02 09:24:30
Original
2562 people have browsed it

Detailed explanation of what html anchors are

The first step in learning web knowledge is definitely HTML. What is the purpose of the anchor point of html?

To put it simply, for example, if you want to read a very long article accurately by segment, you can use anchor points.

Code:

跳到001 …文字省略  …文字省略
Copy after login

In fact, the anchor point only needs name. The id is added to make it more compatible.

The value of href must be the same as name \ i d Consistent, "#" must be added in front. The above code is compatible in ie6/7 and ff, but not in ie8.

Because thevalue of our anchor point is empty, we can just add a space so as not to affect the appearance.

The following code can be compatible with ie8

跳到001 …文字省略  & n b s p  …文字省略
Copy after login

Another question, do you want to display an anchor content of a certain page (such as: 321.html)?

The code is as follows

跳到001 …文字省略  & n b s p  …文字省略
Copy after login

All code display:


The above is the detailed content of Detailed explanation of what html anchors are. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!