Home  >  Article  >  Web Front-end  >  a标签的name属性和id属性实现页内跳转的方法_HTML/Xhtml_网页制作

a标签的name属性和id属性实现页内跳转的方法_HTML/Xhtml_网页制作

WBOY
WBOYOriginal
2016-05-16 16:41:001971browse

以前只知道用a标签的name属性来跳转,今天才知道还可以用id。
不知道还有没有其他的方式。name可以有重复多个,id只能用一次,当然,如果你不打算遵守规范,用几次都行。
demo如下:

复制代码
代码如下:





Demo--页面内跳转



页内跳转演示1——A标签href="#jump1"
页内跳转演示1——A标签href="#jump1"
页内跳转演示2——A标签href="#jump2"

页内跳转演示1——任意标签id="jump1"


页内跳转演示1——A标签name="jump2"



Statement:
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