首页 > 编程知识 正文

网页制作锚点链接,表示跳转到页面锚点的代码

时间:2023-05-04 22:21:18 阅读:134288 作者:3760

定位点1.锚点链接的使用

1 .使用a标记应用herf属性,href属性='#id名称'

2 .单击超链接对象,跳转到指定的位置

2.利用锚点链接在同一个页面中的切换效果:

代码如下:

style /*默认间隙清晰的*/*{ margin: 0; padding: 0; (/)清晰的a标签默认下划线样式(/a )文本解码: none; } .big_box{ width: 300px; height: 300px; /*箱子居中*/margin : 0自动; }清除} ul{ /*前面的小点*/list-style: none; 浮动:左; width: 100px; height: 300px; background-color: pink; } ul li{ margin-top: 50px; 文本照明3360中心; } .small_box{ width: 200px; height: 300px; /*隐藏大箱子的溢出部分*/overflow: hidden; 浮动:左; }.small _ box # one { width :200 px; height: 300px; background-color : RGB (197、51、75 ); /*文字水平居中*/text-align :中心; /*文字垂直中央*/line-height: 300px; }.small _ box # two { width :200 px; height: 300px; background-color : RGB (44,173,224 ); 文本照明3360中心; line-height: 300px; }.small _ box # three { width :200 px; height: 300px; background-color : RGB (127,51,197 ); 文本照明3360中心; line-height: 300px; }/stylebodydivclass=' big _ box ' ulliahref=' # one '小猫/a/li lia href='#two '小狗/a/li lia href='#three小鸡uue

点击左侧的小猫,就会出现第一个箱子。

点击左侧的小狗,就会出现第二个箱子。

点击左侧的小鸡,就会出现第三个箱子。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。