html - Sticky navigation bar won't follow page scrolling in Internet Explorer and Chrome -
html - Sticky navigation bar won't follow page scrolling in Internet Explorer and Chrome -
i've coded website in safari works want it. but, seems horisontal sticky navbar won't follow page scrolling in net explorer, chrome , firefox.
i've tried apply overflow: auto, doesn't help , have hard time solve this. know how it?
<div id="navbar"> <div id="navbar-links"> <ul> <li><a href="index.html">home |</a></li> <li><a href="index.html#features">features |</a></li> <li><a href="index.html#xxx">xxx |</a></li> <li><a href="index.html#xxx">xxx |</a></li> <li><a href="index.html#xxx">xxx |</a></li> <li><a href="index.html#demo">demo |</a></li> <li><a href="index.html#xxx">xxx |</a></li> <li><a href="index.html#xxx">xxx |</a></li> <li><a href="index.html#contact">contact |</a></li> </ul> </div> <div id="navbar-logo"> <a href="index.html"><h1>name<img src="images/logo.png" height="30px" width="30px"></h1></a> </div>
#navbar h1{ font-family: "gill sans", arial, helvetica, sans-serif; font-weight: 500; letter-spacing: 10px; font-size: 32px; text-align: center; padding-left: 2%; } #navbar-logo a{ font-family: "gill sans", arial, helvetica, sans-serif; font-weight: 500; letter-spacing: 10px; font-size: 32px; text-align: center; padding-left: 2%; text-decoration: none; color: #000000; display: block; } #navbar{ width: 100%; background-color: #ffffff; padding: 14px 10px 4px 10px; position: -webkit-sticky; top: 0; z-index: 1; overflow: auto; } #logo{ width: 40%; float: left; margin: 0px; padding: 0px; } #navbar-links{ width: 60%; float: right; margin: 0px; padding-right: 2%; list-style: none; font-family: "gill sans", arial, helvetica, sans-serif; letter-spacing: 5px; font-weight: normal; font-size: 11px; text-transform: uppercase; text-align: right; } #navbar-links ul{ width: 100%; margin: 0px; float: right; } #navbar-links li{ display: inline; padding: 0px; } #navbar-links li a:link{ color: #000000; text-decoration: none; } #navbar-links li a:visited { color: #000000; text-decoration: none; } #navbar-links li a:hover{ color: #c3c3c3; text-decoration: none; } #navbar-links li a:active{ color: #c3c3c3; text-decoration: none; }
try:
#navbar { position: fixed; }
webkit rendering engine apple safari browsers , position: -webkit-sticky
not work in other browsers. read more css position
property here.
html css google-chrome
Comments
Post a Comment