-1

Does anyone have any idea why space-between doesn't work? I was trying to inspect it, but the prompt says that I shouldn't use flex-wrap? I didn't though. Would be grateful for any suggestions 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>
Veronica
  • 7
  • 3
  • please use `justify-content` instead of `align-content` – Waqas Ahmad May 16 '23 at 08:35
  • It's a matter of the axis. In your CSS, replace the nav component declaration align-content for justify-content. You may find this [question](https://stackoverflow.com/questions/32551291/in-css-flexbox-why-are-there-no-justify-items-and-justify-self-properties) helpful. – alejandroMAD May 16 '23 at 08:38

1 Answers1

-1

use justify-content instead of align-content like so:

* {
  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>
Samuel Akhaze
  • 80
  • 1
  • 5