У меня почему- то не работает свойство position: sticky, для навигационного горизонтального меню.
Вот мой код HTML и CSS:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TEST</title>
<link rel="stylesheet" href="kitchen3_css.css">
</head>
<body>
<header>
<div id="title-and-photo">
<a href="test.html" id="photo-with-link"><img src="logo.png" width="125" height="115" id="photo-of-title"></a>
<h1 id="title-of-site">TEST</h1>
</div>
<nav>
<ul id="navigation-of-header">
<li class="points-of-navigation"><a href="test.html" class="a-of-nav">TEST</a></li>
<li class="points-of-navigation"><a href="test.html" class="a-of-nav">TEST</a></li>
<li class="points-of-navigation"><a href="test.html" class="a-of-nav">TEST</a></li>
<li class="points-of-navigation"><a href="test.html" class="a-of-nav">TEST</a></li>
<li class="points-of-navigation"><a href="test.html" class="a-of-nav">TEST</a></li>
</ul>
</nav>
</header>
<main>
<p>test</p>
</main>
</body>
</html>
body {
background: linear-gradient(to top right, #3399ff 0%, #ff66ff 100%) fixed;
}
#title-and-photo {
background: linear-gradient(to top right, #3399ff 0%, #cc33ff 83%);
height: 125px;
width: 1067px;
margin-left: -8px;
margin-top: -35px;
}
#photo-of-title {
float:left;
display: block;
margin-left: 270px;
}
#title-of-site {
margin-left: 400px;
font-size: 330%;
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
padding-top: 20px;
margin-right: 0px;
}
#photo-with-link:hover {
opacity: 0.8;
}
nav {
clear: left;
}
#navigation-of-header {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background: linear-gradient(to top, #0066ff 23%, #66ffff 92%);
width: 1067px;
margin-left: -8px;
margin-top: 0px;
position: -webkit-sticky;
position: sticky;
top: 1;
z-index: 1;
}
.points-of-navigation {
float: left;
margin-left: 106px;
}
.points-of-navigation a {
display: block;
color: black;
text-decoration: none;
padding: 10px 10px;
text-align: center;
font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
font-size: 108%;
}
/* ЭТО МОЖЕТЕ НЕ ЧИТАТЬ!
.a-of-nav {
position: relative;
text-decoration: none;
}
.a-of-nav:after {
content: '';
display: block;
position: absolute;
width: 0;
left: 0;
height: 3px;
background-color: #191970;
transition: width 0.4s ease-out;
}
.a-of-nav:hover:after,
.a-of-nav:focus:after {
width: 100%;
}
*/
p { /* ЭТО Я СДЕЛАЛ, ЧТОБЫ ПОЯВИЛАСЬ ПОЛОСА ПРОКРУТКИ ВНИЗ, ПОТОМУ ЧТО Я ХОТЕЛ ПРОТЕСТИТЬ РАБОТАЕТ ЛИ - position-sticky */
height: 800px;
clear: left;
padding-top: 600px;
}