Trying to put a magnifying glass in my search bar (on the left) and put the "Join" and "Login" side by side (on right side)

Viewed 91

For some reason I can't put this magnifying glass in the search bar (path: images/magnifying-glass.png). I also cant get the "Join" and "login" link to go side by side. I also need to lower the gray-ish lines (top and bottom) to look like image below.

It should look like this:

enter image description here

@import url('https://fonts.googleapis.com/css?family=Poppins');
body {
  font-family: 'Poppins';
}

header>div {
  padding: 0 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid lightgray;
}

nav {
  width: 600px;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: black;
}

.blackHeart {
  width: 20px;
  margin-right: 1rem;
}

.searchmenu {
  padding-top: 12.5px;
  padding-bottom: 12.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  width: 50px;
  margin-left: .3rem;
  display: right;
  padding-right: 10px;
}

.topnav,
.searchContainer {
  width: 100%;
}

.topnav input[type=text] {
  padding: 6px;
  font-size: 17px;
  border: none;
}

.topnav .search-container button {
  width: 9%;
  padding: 6px;
  background: red;
  font-size: 17px;
  border: none;
  cursor: pointer;
  color: white;
}

.topnav .search-container button:hover {
  background: black;
}

.search {
  background-color: rgba(211, 211, 211, 0.463);
  width: 78%;
}

.searchmenu ul {
  padding: 0;
  width: 100%;
  display: flex;
  align-items: center;
}

.account {
  list-style: none;
  text-decoration: none;
}

.account_join {
  list-style: none;
  text-decoration: none;
  color: black;
  display: flex;
}

.account_login {
  display: flex;
  list-style: none;
  text-decoration: none;
  color: black;
}

.searchDiv {
  width: 78%;
  display: flex;
  align-items: center;
  border: 1px solid black;
  background-color: rgba(211, 211, 211, 0.463);
}

.icon {
  width: 20px;
  height: 20px;
}

.amazing_section {
  display: flex;
  justify-content: center;
  height: 600px;
  background-color: rgba(232, 217, 217, .3);
  text-align: center;
}

.desc {
  padding-left: 400px;
  padding-right: 400px;
  font-size: 20px;
}

.see_button {
  height: 50px;
  width: 100px;
  background-color: #FB3B49;
  box-shadow: 8px 8px 0 rgba(251, 59, 73, .2);
  border: none;
  cursor: pointer;
  color: white;
}

.amazing_join {
  text-decoration: none;
  color: black;
  padding-left: 40px;
}
NPM Clone Nifty Penguin Magic npm Enterprise Products Solutions Resources Docs Support Search Join Log In Build amazing things Essential JavaScript development tools that help you go to market faster and build powerful applications using modern open source
code. See plans Join for free Bring the best of open source to your company npm is the tool used by over 11,000,000 JavaScript developers around the world. Your developers already use it. Your company depends on it. Create an Org and get more out of the
tools your team already knows and loves. Zero configuration Create an org, add your team, and start collaborating. Nothing to configure, set up, or manage. Team management Control who has access to what modules within your team namespace using straightforward
team management capabilities. Familiar features npm Orgs has 100% parity with all the public npm registry features your developers already use. npm audit Enjoy the security auditing features built into the npm client, a zero-friction way to make open
source software safer. Create an Org

<!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>Document</title>
</head>
<header>
  <div>
    <div>
      <img class="blackHeart" src="images/black-heart.png" alt="black heart" />
      <span> Nifty Penguin Magic </span>
    </div>
    <nav>
      <ul>
        <li><a href="#"> npm Enterprise </a></li>
        <li><a href="#"> Products </a></li>
        <li><a href="#"> Solutions </a></li>
        <li><a href="#"> Resources </a></li>
        <li><a href="#"> Docs </a></li>
        <li><a href="#"> Support </a></li>
      </ul>
    </nav>
  </div>

  <div class="searchmenu">
    <ul>
      <div>
        <img class="logo" src="images/npm-logo.png" alt="npm logo">
      </div>
      <div class="topnav">
        <div class="search-container">
          <form>
            <input type="text" placeholder="Search.." name="search" class="search">
            <button type="submit">Submit</button>
          </form>
        </div>
      </div>
      <div>
        <a class="account_join" href="#">Join</a>
        <a class="account_login" href="#">Log In</a>
      </div>
    </ul>
  </div>
</header>
<section class="amazing_section">
  <ul>
    <header style="font-size: 80px;" class="title"> Build amazing things</header>
    <p class="desc">Build amazing things Essential JavaScript development tools that help you go to market faster and build powerful applications using modern open source code. </p>
    <button type="submit" class="see_button"> See Plans</button>
    <a class="amazing_join" href="#">Join For Free</a>
  </ul>
</section>


<body>

</body>

</html>
Thank you for any help. P.S this is for a school project I am doing.

1 Answers

You can use a magnifying glass unicode or you can use it as background-image.

just change background-image: url('images/magnifying-glass.png') on input.search on css. And this should work if your path doesnt work take the entire www.yourwebsite.com/image/magnifying-glass.png. I also added a css to flex your join and login so you can see them side by side.

@import url('https://fonts.googleapis.com/css?family=Poppins');
body {
  font-family: 'Poppins';
}

header>div {
  padding: 0 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid lightgray;
}

nav {
  width: 600px;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: black;
}

.blackHeart {
  width: 20px;
  margin-right: 1rem;
}

.searchmenu {
  padding-top: 12.5px;
  padding-bottom: 12.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  width: 50px;
  margin-left: .3rem;
  display: right;
  padding-right: 10px;
}

.topnav,
.searchContainer {
  width: 100%;
}

.topnav input[type=text] {
  padding: 6px;
  font-size: 17px;
  border: none;
}

.topnav .search-container button {
  width: 90px;
  padding: 6px;
  background: red;
  font-size: 17px;
  border: none;
  cursor: pointer;
  color: white;
}

.topnav .search-container button:hover {
  background: black;
}

.search {
  background-color: rgba(211, 211, 211, 0.463);
  width: 78%;
}

.searchmenu ul {
  padding: 0;
  width: 100%;
  display: flex;
  align-items: center;
}

.account {
  list-style: none;
  text-decoration: none;
}

.account_join {
  list-style: none;
  text-decoration: none;
  color: black;

}

.account_login {
  list-style: none;
  text-decoration: none;
  color: black;
}

.searchDiv {
  width: 78%;
  display: flex;
  align-items: center;
  border: 1px solid black;
  background-color: rgba(211, 211, 211, 0.463);
}

.icon {
  width: 20px;
  height: 20px;
}

.amazing_section {
  display: flex;
  justify-content: center;
  height: 600px;
  background-color: rgba(232, 217, 217, .3);
  text-align: center;
}

.desc {
  padding-left: 400px;
  padding-right: 400px;
  font-size: 20px;
}

.see_button {
  height: 50px;
  width: 100px;
  background-color: #FB3B49;
  box-shadow: 8px 8px 0 rgba(251, 59, 73, .2);
  border: none;
  cursor: pointer;
  color: white;
}

.amazing_join {
  text-decoration: none;
  color: black;
  padding-left: 40px;
}

.joinlogin {display:flex;
  grid-gap: 10px;
  white-space:nowrap;
  }
  
input.search {
    background-image: url('https://cdn0.iconfinder.com/data/icons/very-basic-2-android-l-lollipop-icon-pack/24/search-512.png');
    background-size:contain;
    background-repeat: no-repeat;
    }
NPM Clone Nifty Penguin Magic npm Enterprise Products Solutions Resources Docs Support Search Join Log In Build amazing things Essential JavaScript development tools that help you go to market faster and build powerful applications using modern open source
code. See plans Join for free Bring the best of open source to your company npm is the tool used by over 11,000,000 JavaScript developers around the world. Your developers already use it. Your company depends on it. Create an Org and get more out of the
tools your team already knows and loves. Zero configuration Create an org, add your team, and start collaborating. Nothing to configure, set up, or manage. Team management Control who has access to what modules within your team namespace using straightforward
team management capabilities. Familiar features npm Orgs has 100% parity with all the public npm registry features your developers already use. npm audit Enjoy the security auditing features built into the npm client, a zero-friction way to make open
source software safer. Create an Org

<!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>Document</title>
</head>
<header>
  <div>
    <div>
      <img class="blackHeart" src="images/black-heart.png" alt="black heart" />
      <span> Nifty Penguin Magic </span>
    </div>
    <nav>
      <ul>
        <li><a href="#"> npm Enterprise </a></li>
        <li><a href="#"> Products </a></li>
        <li><a href="#"> Solutions </a></li>
        <li><a href="#"> Resources </a></li>
        <li><a href="#"> Docs </a></li>
        <li><a href="#"> Support </a></li>
      </ul>
    </nav>
  </div>

  <div class="searchmenu">
    <ul>
      <div>
        <img class="logo" src="images/npm-logo.png" alt="npm logo">
      </div>
      <div class="topnav">
        <div class="search-container">
          <form>
            <input type="text" placeholder="     Search.." name="search" class="search">
            <button type="submit">Search</button>
          </form>
        </div>
      </div>
      <div class="joinlogin">
        <a class="account_join" href="#">Join</a>
        <a class="account_login" href="#">Log In</a>
      </div>
    </ul>
  </div>
</header>
<section class="amazing_section">
  <ul>
    <header style="font-size: 80px;" class="title"> Build amazing things</header>
    <p class="desc">Build amazing things Essential JavaScript development tools that help you go to market faster and build powerful applications using modern open source code. </p>
    <button type="submit" class="see_button"> See Plans</button>
    <a class="amazing_join" href="#">Join For Free</a>
  </ul>
</section>


<body>

</body>

</html>

Related