Html css位置不适用于粘性

Html css位置不适用于粘性,html,css,Html,Css,我在css文件中使用了overflow:hidden。 我不熟悉css和web开发。 所以我想知道如何在导航栏上使用sticky。 当我删除溢出属性时,背景会发生变化。 以下是我的代码。 如果你能给我解决这个问题的代码,那将是一个很大的帮助 html, 身体 分区, 跨度 小程序, 对象 iframe, h1, h2, h3, h4, h5, h6, P 块引用, 之前, A. 缩写, 缩略语 住址 大的 提及 密码 德尔, dfn, 相对长度单位, img, ins, kbd, Q s 桑普

我在css文件中使用了overflow:hidden。 我不熟悉css和web开发。 所以我想知道如何在导航栏上使用sticky。 当我删除溢出属性时,背景会发生变化。 以下是我的代码。 如果你能给我解决这个问题的代码,那将是一个很大的帮助

html, 身体 分区, 跨度 小程序, 对象 iframe, h1, h2, h3, h4, h5, h6, P 块引用, 之前, A. 缩写, 缩略语 住址 大的 提及 密码 德尔, dfn, 相对长度单位, img, ins, kbd, Q s 桑普, 小的 罢工 坚强的 附属的, 啜饮, tt, var, B U 我 居中 dl, dt, dd, ol,, ul, 锂, 字段集, 类型 传奇 标签 桌子 说明文字 t身体, 特富特, thead, tr, th, 运输署, 文章 在一边 帆布 细节, 嵌入 图形 figcaption, 页脚, 标题, hgroup, 菜单 导航, 输出 红宝石 部分 总结 时间 做记号 音频 录像带{ 保证金:0; 填充:0; 边界:0; 垂直对齐:基线; } 文章 在一边 细节, figcaption, 页脚, 图形 标题, hgroup, 菜单 导航, 部分{ 显示:块; } .标题{ 边缘顶部:20px; 高度:40px; 宽度:100% } .左_头a{ 利润率:0.20px; 文字装饰:无; 颜色:绿色; 浮动:左; } .右箭头标题{ 保证金:5px0; 浮动:对; 填充:12px; } navbar先生{ 高度:30px; } 保险商实验室{ 列表样式类型:无; 边框:1px实心e7e7e7; 背景色:F3; 保证金:0; 填充:0; 溢出:隐藏; 位置:粘性; 排名:0; } 李{ 浮动:左; } 李阿{ 显示:块; 颜色:黑色; 文本对齐:居中; 填充:15px 20px; 文字装饰:无; } 李娜:停下来{ 背景颜色:绿色; 颜色:白色; } .页脚{ 高度:200px; } 笔记本电脑的唯一一站&;他们的配件! .内容{ 高度:700px; } 笔记本电脑的唯一一站&;他们的配件! 请试试这个

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,
code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,
fieldset,form,legend,label,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,
figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{
    margin:0;
    padding:0;
    border:0;
    vertical-align: baseline;
}
article,aside,details,figcaption,footer,figure,header,hgroup,menu,nav,section{
    display: block;
}

.header {
    margin-top: 20px;
    height: 40px;
    width: 100%
}
.left_header a {
    margin: 0 0 0 20px;
    text-decoration: none;
    color: green;
    float: left;
}
.right_header {
    margin: 5px 0 0 0;
    float: right;
    padding: 12px;
}
.navbar {   
    position: -webkit-sticky;
    position: sticky;
    top: 0;
}
ul {
    list-style-type: none;
    border: 1px solid #e7e7e7;
    background-color: #f3f3f3;
    margin : 0;
    padding: 0;    
}
ul:after{ content: ""; height: 0px; overflow: hidden; clear: both; display: block; }
li {
    float: left;
}
li a {
    display: block;
    color: black;
    text-align: center;
    padding: 15px 20px;
    text-decoration: none;
}
li a:hover {
    background-color: green;
    color: white;
}
.footer {
    height: 200px;
}