有人知道為什么間隔空間不起作用嗎?我試圖檢查它,但提示說,我不應該使用flex-wrap?我沒想到。如有任何建議,我將不勝感激 在此輸入圖像描述
* {
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>
使用justify-content代替align-content,如下所示:
* {
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;
justify-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>
上一篇vue idea無提示
下一篇vue ie7