点击按钮回顶
.topIcon { position: fixed; bottom: 5rem; right: 1rem; width: 2rem; height: 2rem; border-radius: 50%; background:url(../assets/images/gotop.png)center center no-repeat; background-size: cover; }
固定导航栏案例
顶部距离 固定导航栏
- 内容部分
#topPart{ width: 100%; height: 100px; background-color: yellow; } .isFixed { position: fixed; top: 0; z-index: 10; } #navBar { width: 100%; height: 50px; background-color: red; } #mainPart { width: 100%; } #mainPart ul { width: 100%; } #mainPart ul li { width: 100%; height: 40px; background-color: orange; margin-bottom: 10px; }
以上这篇vue 中固定导航栏的实例代码就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持考高分网。



