Home > Web Front-end > HTML Tutorial > How to set anchor positioning in html? Summary of setting anchor point positioning methods

How to set anchor positioning in html? Summary of setting anchor point positioning methods

云罗郡主
Release: 2018-10-09 17:10:43
forward
6206 people have browsed it

A lot of html will encounter anchor positioning, so how to set anchor positioning in html? Let's summarize what are the methods for setting anchor positioning in HTML? And summarize the methods of setting anchor positioning in html.

I know several ways to set anchor positioning in html, and I would like to share them with you:

1. Use id positioning:

The code is as follows:

<a href="#1F" name="1F">锚点1</a> 
<p name="1F"> 
<p> 
11111111111 
</br> 
11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br>11111111111 
</br> 
</p> 
</p>
Copy after login

Such positioning can be targeted at any label.

2. Use name positioning:

The code is as follows:

<a href="#5F">锚点5</a> 
</br></br></br></br></br></br></br></br></br></br></br></br></br></br></br></br></br></br></br> 
<a name="5F">1111111</href>
Copy after login

Using the name attribute can only be used to position the a tag, but not other tags such as p. Play a positioning role.

3. Use js positioning

The code is as follows:

<li class="" onclick="javascript:document.getElementById(&#39;here&#39;).scrollIntoView()"></li>
Copy after login

The above is how to set anchor positioning in html? A comprehensive introduction to setting up anchor point positioning methods. If you want to know more about HTML tutorials, please pay attention to phpphilanthropic training.

The above is the detailed content of How to set anchor positioning in html? Summary of setting anchor point positioning methods. For more information, please follow other related articles on the PHP Chinese website!

source:jb51.net
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template