如何为网站创建粘性标题栏 [英] How to create sticky header bar for a website

查看:122
本文介绍了如何为网站创建粘性标题栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为网站创建一个粘性标题栏,就像这个网站上的粘性标题(http://www.fizzysoftware.com/),如果有任何关于可以帮助我编码或帮助我的任何资源创造相同。您的回复对我来说非常有帮助。

I want to create a sticky header bar for a website just like the sticky header on this website (http://www.fizzysoftware.com/) if any on can can help me out with coding or any resource that helps me to create the same. Your reply would be of great help to me.

推荐答案

在您的CSS中,添加

position: fixed;

添加到您的标题元素。真的很简单。
下次尝试右键点击您在网站上看到的内容并选择检查元素。我认为每个现代浏览器都有它。非常有用的功能。

to your header element. It's just that simple, really. And next time, try to use right click on something you see on website and choose "Inspect element". I think that every modern browser has it now. Very useful function.

这篇关于如何为网站创建粘性标题栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆