此问题已在此处有答案:
In CSS Flexbox, why are there no "justify-items" and "justify-self" properties?(6个回答)
3天前关闭。
有人知道为什么间隔空间不起作用吗?我试图检查它,但提示说,我不应该使用flex-wrap?但我没有。感谢您的任何建议enter image description here
* {
margin: 0;
padding: 0;
font-family: "Poppins", sans-serif;
box-sizing: border-box;
}
body {
background: #000;
color: #fff;
}
.header {
width: 100%;
height: 100vh;
background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
url(/images/header-image.png);
background-size: cover;
padding: 10px 8%;
position: relative;
}
nav {
display: flex;
align-items: center;
align-content: space-between;
padding: 10px 0;
}
<!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" />
<link rel="stylesheet" href="/style.css" />
<title>Netflix</title>
</head>
<body>
<div class="header">
<nav>
<img src="/images/logo.png" class="logo" alt="logo" />
<button>English</button>
<button>Sign In</button>
</nav>
</div>
</body>
</html>
1条答案
按热度按时间km0tfn4u1#
使用justify-content代替align-content,如下所示: