可以使用网页的锚点,即<a>标签的id属性,如<a id="C6">Chapter 6</a>当从另处页面连接到该页地址加#C6时就会跳转到此处。
示例:
网页a.htm
<!DOCTYPE html><head>
<title>A</title>
</head>
<body>
<a href="b.htm#C6">B - Chapter 6</a>
</body>
</html>
网页b.htm
<!DOCTYPE html><head>
<title>B</title>
</head>
<body>
<h2>Chapter 1</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 2</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 3</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 4</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 5</h2>
<p>This chapter explains ba bla bla</p>
<h2><a id="C6">Chapter 6</a></h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 7</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 8</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 9</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 10</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 11</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 12</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 13</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 14</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 15</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 16</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 17</h2>
<p>This chapter explains ba bla bla</p>
</body>
</html>
运行效果:
一个页面跳转到另一个页面?使用a标签就可以啊。如:
<a href="http://www.baidu.com">百度跳转</a>这样就可以实现当前页面跳转到百度首页
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)