Html and CSS help

I am writing the index.html of my website and my shopping cart will not settle in with the rest of my topnav. What is the problem?

<!DOCTYPE html5>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="description" content="Caleb Diener photo profile ">
<meta name="keywords" content="Hire, Drone, Photo, phography">
<meta name="author" content="Caleb Diener">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="fontawesome/css/all.css" rel="stylesheet">
<title>Diener Photography</title>

<style>
body {margin:0;font-family:Arial}
.topnav {
  overflow: hidden;
  background-color: #ffffff;
}


.topnav a {
  float: left;
  display: block;
  color: #858585;
  text-align: center;
  padding: 25px 20px;
  text-decoration: none;
  font-size: 20px;
}

.topnav .icon {
  display: none;
}

.dropdown {
  float: left;
  overflow: hidden;
}


 .p1[data-count]:after{
  position:absolute;
  right:10%;
  top:8%;
  content: attr(data-count);
  font-size:40%;
  padding:.2em;
  border-radius:50%;
  line-height:1em;
  color: white;
  background:rgba(0,0,255,.85);
  text-align:center;
  min-width: 1em;
}


.dropdown .dropbtn {
  border: none;
  outline: none;
  background-color: inherit;
  font-family: inherit;
  margin: 0;
  display: block;
  color: #858585;
  text-align: center;
  padding: 25px 20px;
  text-decoration: none;
  font-size: 20px;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  text-decoration: none;
  font-size: 15px;
}

.dropdown-content a {
  float: none;
  color: #858585;
  text-decoration: none;
  display: block;
  text-align: left;;
  font-size: 15px;
}

.topnav a:hover, .dropdown:hover .dropbtn .dropdown-content{
  color: black;
}

.dropdown-content a:hover {
  background-color: #ddd;
  color: black;
}

.dropdown:hover .dropdown-content {
  display: block;
}


@media screen and (max-width: 945px) {
  .topnav a:not(:first-child), .dropdown .dropbtn {
    display: none;
  }
  .topnav a.icon {
    float: right;
    display: block;
  }
}

@media screen and (max-width: 945px) {
  .topnav.responsive {position: relative;}
  .topnav.responsive .icon {
    position: absolute;
    right: 0;
    top: 0;
  }
  .topnav.responsive a {
    float: none;
    display: block;
    text-align: left;
  }
  .topnav.responsive .dropdown {float: none;}
  .topnav.responsive .dropdown-content {position: relative;}
  .topnav.responsive .dropdown .dropbtn {
    display: block;
    width: 100%;
    text-align: left;
  }
}
</style>
</head>
<body>

<div class="topnav" id="myTopnav">
  <a href="index.html" style=" padding: 5px 5px;"><img src="logo.gif" height=60px ></a>
  <a href="index.html"style="color: black;">Home</a>

  <div class="dropdown">
    <button class="dropbtn">Galleries
      <i style="font-size: 16px;" class="fas fa-angle-double-down"></i>
    </button>
    <div class="dropdown-content">
      <a href="photogall.html">Still Photos</a>
      <a href="videogall.html">Videos</a>
    </div>
    </div>
    <div class="dropdown">
      <button class="dropbtn">Services
        <i style="font-size: 16px;" class="fas fa-angle-double-down"></i>
      </button>
      <div class="dropdown-content">
        <a href="drone-about">Drone</a>
        <a href="service-about">Normal</a>
      </div>
      </div>
  <a href="contact.html">Contact</a>
  <a href="cart.html">
  <span class="p1 fa-stack has-badge" data-count="4">
    <i class="fas fa-shopping-cart fa-stack-1x" data-count="4b"></i>
  </span></a>
  <a href="javascript&colon;void(0);" style="font-size:20px;" class="icon" onclick="myFunction()"><i class="fas fa-bars"></i></a>
</div>

<img src="mountains.jpg" height=100% width=100% >


<script>
function myFunction() {
  var x = document.getElementById("myTopnav");
  if (x.className === "topnav") {
    x.className += " responsive";
  } else {
    x.className = "topnav";
  }
}
</script>


</body>
</html>
1 Like

I can help in a live session.