Html 如何单击链接,然后滚动并显示div
我有三个头衔,像这样:Html 如何单击链接,然后滚动并显示div,html,css,Html,Css,我有三个头衔,像这样: <a href="#">title 1</a> <a href="#">title 2</a> <a href="#">title 3</a> <div id="one">there is a describe for title 1</div> <div id="two">there is a describe for title 2</div> &
<a href="#">title 1</a>
<a href="#">title 2</a>
<a href="#">title 3</a>
<div id="one">there is a describe for title 1</div>
<div id="two">there is a describe for title 2</div>
<div id="three">there is a describe for title 3</div>
我有3个div来解释它们,如下所示:
<a href="#">title 1</a>
<a href="#">title 2</a>
<a href="#">title 3</a>
<div id="one">there is a describe for title 1</div>
<div id="two">there is a describe for title 2</div>
<div id="three">there is a describe for title 3</div>
标题1有一个描述
标题2有一个描述
标题3有一个描述
要点:每个描述都是多行的(本页有overflow-y:scrool,本页高度太长)
现在我想当用户单击标题1时,页面滚动并显示其他标题的
,依此类推
要点:通过HTML或CSS或两者,而不是JS,我使用:
<a href="#one">title 1</a>
而且工作正常 你试过了吗?@rsilva我试过了,工作正常