@swyt

Почему у меня список сместился на половину вверх?

Видео с демонстрацией проблемы
HTML
<!DOCTYPE html>
<html>
	<head>
		<title>Navbar</title>
		<link rel="stylesheet" href="css.css">
		<link href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@900&display=swap" rel="stylesheet">
	</head>
	<body>
		<nav>
			<div class="logo">
				<h4>
					NAVBAR
				</h4>
			</div>
			<div class="meny">
				<div class="line1"></div>
				<div class="line2"></div>
				<div class="line3"></div>
			</div>
			<ul class="nav_links">
				<li><a href="#">aaa</a></li>
				<li><a href="#">bbb</a></li>
				<li><a href="#">ccc</a></li>
			</ul>
		</nav>
		<script src="js.js"></script>
	</body>
</html>


CSS

* {	
	margin: 0px;
	padding: 0px;
	box-sizing: border-box;
}
nav {
	display: flex;
	align-items: center;
	background-color: rgb(160, 29, 29);
	height: 8vh;
	font-family: 'Inconsolata', monospace;
}
.logo {
	display:inline-block;
	text-transform: uppercase;
	letter-spacing: 3px;
	font-size: 20px;
	cursor: pointer;
	width: auto;
	margin-left: 10%;

}
.nav_links {
	display: flex;
	list-style: none;
	justify-content: space-around;
	width: 50%;
	height: 100%;
	align-items: center;
	margin-left: auto;
}
.nav_links a {
	text-decoration: none;
	font-weight: bold;
}
.nav_links li a {
	color: black;
	transition: all 0.3s ease 0s;
}
.nav_links li a:hover {
	color: wheat;
}
@media screen and (max-width: 768px) {
	.meny div {
		width: 30px;
		height: 4px;
		background: white;
		border-radius: 4px;
		margin: 5px;
		transition: all 0.3s ease;
	}
	nav{
	position: relative;
	}
	.meny {
		position: absolute;
		cursor: pointer;
		right: 3%;
		top: 50%;
		transform: translate(-5%, -50%);
		z-index: 2;
	}
	.nav_links {
		position: fixed;
		background: rgb(160, 29, 29);
		height: 100vh;
		width: 100%;
		flex-direction: column;
		clip-path: circle(100px at 90% );
		-webkit-clip-path: circle(100px at 90% -15%);
		transition: all 1s ease-out;
		pointer-events: none;
	}
	.nav_links.open {
		clip-path: circle(100px at 90% -15%);
		-webkit-clip-path: circle(1100px at 90% -15%);
		pointer-events: all;
	}
	.nav_links li {
		opacity: 0;
	}
	.nav_links li:nth-child(1){
		transition: all 0.5s ease 0.2s;
	}
	.nav_links li:nth-child(2){
		transition: all 0.5s ease 0.4s;
	}
	.nav_links li:nth-child(3){
		transition: all 0.5s ease 0.6s;
	}
	li.fade {
		opacity: 1;
	}
	.toggle .line1 {
		transform: rotate(-45deg) translate(-6px,6px);
	}
	.toggle .line2 {
		opacity: 0;
	}
	.toggle .line3 {
		transform: rotate(45deg) translate(-6px,-6px);
	}
}

  • Вопрос задан
  • 95 просмотров
Решения вопроса 1
notiv-nt
@notiv-nt
Как ваше ничего? Да, моё тоже
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы