当前位置: 首页 > news >正文

css 实现电梯导航

实现原理:利用css实现电梯导航很简单,基本原理就是通过a标签绑定跳转目标的id来实现的

  html代码:

 <div class="body"><div class="top" id="top"></div><div class="con1" id="con1"></div><div class="con2" id="con2"></div><div class="footer" id="footer"></div></div><div class="navs"><div class="navs_top"><a href="#top">top</a></div><div class="navs_nav"><a href="#con1">nav</a></div><div class="navs_con"><a href="#con2">con</a></div><div class="navs_footer"><a href="#footer">footer</a></div></div>

css代码:

.top {width: 80%;background-color: aqua;height: 300px;margin: auto;}.con1 {position: relative;width: 80%;background-color: brown;height: 300px;margin: auto;}.con2 {width: 80%;background-color: wheat;height: 300px;margin: auto;}.footer {width: 80%;background-color: rebeccapurple;height: 300px;margin: auto;}.navs {position: fixed;right: 4.375rem;top: 50%;}html{/* 页面滚动效果 */scroll-behavior: smooth;}

效果演示:

http://www.lryc.cn/news/135172.html

相关文章:

  • 【Spring Boot】Spring Retry减少1000 行代码讲解
  • 【数据结构OJ题】相交链表
  • 【华为OD机试】最小传输时延I【2023 B卷|200分】
  • Android13 网络 Adb 默认开启
  • Git分享-规范/建议/技巧
  • vue3文件下载功能
  • Python调用文心一言的API
  • 【计算机网络八股】计算机网络(一)
  • 记录一次arcgis engine开发版本引入问题
  • 2023年Java毕业设计怎样选题,有哪些注意事项,300道Java毕业设计题目
  • 算法-滑动窗口-串联所有单词的子串
  • 2023年7月京东美妆护肤品小样行业数据分析(京东数据挖掘)
  • 记录Taro巨坑,找不到sass类型定义文件
  • CS1988|C#无法在异步方法中使用ref,in,out类型的参数的问题
  • ubuntu开机失败——ACPI Error
  • 搭建开发环境-操作系统篇(一键搭建开发环境)
  • 人工智能AI绘画接入使用文档
  • 如何使用PyQt进行文件操作
  • 阿里云CDN加速器基本概念与购买开通
  • 2023河南萌新联赛第(六)场:河南理工大学-F 爱睡大觉的小C
  • [C++ 网络协议编程] 域名及网络地址
  • Java【HTTP】什么是 Cookie 和 Session? 如何理解这两种机制的区别和作用?
  • 使用U盘重装Windows10系统详细步骤及配图【官方纯净版】
  • 数据结构之——(手撕)顺序表
  • 冠达管理:非银金融是什么?
  • go 结构体
  • C++学习笔记---- 引用
  • 2023国赛数学建模思路 - 案例:感知机原理剖析及实现
  • Cesium加载Supermap的wmts服务
  • C/C++:C/C++在大数据时代的应用,以及C/C++程序员未来的发展路线