Home > Blockchain >  Header does not display the same for friend as does for me on desktop
Header does not display the same for friend as does for me on desktop

Time:03-07

So This is how I see the Header

How I see it on my computer

How my friend see it on their computer As you can see on my friend picture there alot of white space and things don't aline as they do on mine. but our browsers at 100% zoom and it seems the same on friends other devices too.

I can't work out why maybe I'm missing something so here my code Please help me out here Thanks

/* body style */

@-ms-viewport {
  width: device-width;
}

body {
  background: rgba(0, 0, 0, 0.05);
  color: #000000;
  font-family: "Source Sans Pro", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif !important;
}

/* Add a black background color to the top navigation */

.topnav {
  background-color: #FFF;
  overflow: hidden;
}


/* Style the links inside the navigation bar */

.topnav a {
  float: right;
  display: block;
  color: #333;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  line-height: 25px;
  overflow: hidden;
}


/* Add an active class to highlight the current page */

.active {
  background-color: #fde402;
  color: #ed1010 !important;
  text-decoration: none !important;
}

/* Dropdown container - needed to position the dropdown content */

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


/* Style the dropdown button to fit inside the topnav */

.dropdown .dropbtn {
  font-size: 17px;
  border: none;
  outline: none;
  color: #333;
  padding: 14px 16px;
  background-color: inherit;
  font-family: inherit;
  margin: 0;
}
/* Style the links inside the dropdown */

.dropdown-content a {
  float: none;
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}


/* Add a dark background on topnav links and the dropdown button on hover */

.topnav a:hover,
.dropdown:hover .dropbtn {
  background-color: #fde402;
  color: #ed1010;
  text-decoration: none !important;
}

/* Add a grey background to dropdown links on hover */

.dropdown-content a:hover {
  background-color: #fde402;
  color: #ed1010;
  text-decoration: none !important;
}

/* Show the dropdown menu when the user moves the mouse over the dropdown button */

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

/* The "responsive" class is added to the topnav with JavaScript when the user clicks on the icon. This class makes the topnav look good on small screens (display the links vertically instead of horizontally) */

@media screen and (max-width: 600px) {
  .topnav.responsive {
    position: relative;
  }
  .topnav.responsive a.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 the dropdown content (hidden by default) */

.dropdown-content {
  display: none;
  position: fixed;
  background-color: #FFFFFF;
  min-width: 120px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 99999999;
}

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

/* scroll text style */

.scroll-left {
  height: 50px;
  width: auto;
  overflow: hidden;
  position: relative;
  background: #bd0d0d;
  color: #fcf903;
  font-size: 18px;
  font-weight: 500;
  border: none;
}

.scroll-left p {
  position: absolute;
  width: 130%;
  height: 100%;
  margin: 0;
  line-height: 50px;
  text-align: center;
  /* Starting position */
  transform: translateX(70%);
  /* Apply animation to this element */
  animation: scroll-left 30s linear infinite;
}

/* Move it (define the animation) */

@keyframes scroll-left {
  0% {
    transform: translateX(70%);
  }
  100% {
    transform: translateX(-80%);
  }
}

.Flash {
  float: right;
  background-color: #fcba03;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  display: inline-block;
  font-family: Arial;
  font-size: 16px;
  padding: 10px 15px;
  text-align: center;
  text-decoration: none;
  -webkit-animation: glowing 1500ms infinite;
  -moz-animation: glowing 1500ms infinite;
  -o-animation: glowing 1500ms infinite;
  animation: glowing 1500ms infinite;
  z-index: 99 !important;
}

@-webkit-keyframes glowing {
  0% {
    background-color: #fcba03;
    -webkit-box-shadow: 0 0 3px #B20000;
  }
  50% {
    background-color: #fcc11c;
    -webkit-box-shadow: 0 0 40px #FF0000;
  }
  100% {
    background-color: #B20000;
    -webkit-box-shadow: 0 0 3px #B20000;
  }
}

@-moz-keyframes glowing {
  0% {
    background-color: #fcba03;
    -moz-box-shadow: 0 0 3px #B20000;
  }
  50% {
    background-color: #fcc11c;
    -moz-box-shadow: 0 0 40px #FF0000;
  }
  100% {
    background-color: #B20000;
    -moz-box-shadow: 0 0 3px #B20000;
  }
}

@-o-keyframes glowing {
  0% {
    background-color: #fcba03;
    box-shadow: 0 0 3px #B20000;
  }
  50% {
    background-color: #fcc11c;
    box-shadow: 0 0 40px #FF0000;
  }
  100% {
    background-color: #B20000;
    box-shadow: 0 0 3px #B20000;
  }
}

@keyframes glowing {
  0% {
    background-color: #fcba03;
    box-shadow: 0 0 3px #B20000;
  }
  50% {
    background-color: #fcc11c;
    box-shadow: 0 0 40px #FF0000;
  }
  100% {
    background-color: #B20000;
    box-shadow: 0 0 3px #B20000;
  }
}


/* Style all font awesome icons */

.fa2 {
  padding: 15px !important;
  width: 50px !important;
  text-align: center !important;
  text-decoration: none !important;
  line-height: 25px;
}

.fa1 {
  padding: 15px !important;
  width: 30px !important;
  text-align: center !important;
  text-decoration: none !important;
  margin: 10px !important;
  line-height: 25px;
}


/* Add a hover effect if you want */

.fa:hover {
  opacity: 0.7 !important;
}


/* Set a specific color for each brand */


/* Facebook */

.fa-facebook {
  background: #3B5998 !important;
  color: white !important;
}


/* Twitter */

.fa-twitter {
  background: #55ACEE !important;
  color: white !important;
}


/* instagram */

.fa-instagram {
  background: #833AB4 !important;
  color: white !important;
}


/* instagram */

.fa-amazon {
  background: #FF9900 !important;
  color: white !important;
}

.support {
  padding: 15px !important;
  height: 55px !important;
  text-align: center !important;
  text-decoration: none !important;
  background-color: #bd0d0d !important;
  color: #fff !important;
  line-height: 25px;
}

.support:hover {
  opacity: 0.7;
}

.fundrise {
  padding: 15px !important;
  height: 55px !important;
  text-align: center !important;
  text-decoration: none !important;
  background-color: #FFC300 !important;
  color: #252e6e !important;
  line-height: 25px;
}

.fundrise:hover {
  opacity: 0.7;
}

.ebay {
  background-color: #FFF !important;
  padding: 15px !important;
  height: 55px !important;
  text-align: center !important;
  text-decoration: none !important;
  line-height: 25px;
}

.ebay:hover {
  opacity: 0.7;
}

.ebay2 {
  background-color: #FFF !important;
  padding: 15px !important;
  width: 300px !important;
  text-align: center !important;
  text-decoration: none !important;
  line-height: 25px;
}

.ebay2:hover {
  opacity: 0.7;
}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="viewport" content="width=device-width">
  <meta name="description" content="Portsmouth Lifeguards" />
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="style.css">
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <title>Nav</title>
</head>
<body>
  <!-- ============================== THIS IS THE HEADER IT HAS THE LINKS, LOGO, SOCIAL MEDIA BUTTON, SCROLLBAR100 AND FLASHING DONATE BUTTON  ================================== -->
  <header>
    <div  id="myTopnav">
      <a href="store.html">Store</a>
      <a href="donate.html">Support Us</a>
      <a href="gallery.html">Gallery</a>
      <a href="blogs.html">News</a>
      <a href="join-us.html">Join Us</a>
      <a href="contact.html">Contact</a>
      <a href="lifesaving.html">Lifesaving</a>
      <div >
        <button  data-bs-toggle="dropdown">Equipment
        </button>
        <div >
          <a href="boat.html">Water Rescue Craft</a>
          <a href="vehicle.html">Rescue Vehicles</a>
          <a href="equipment.html">Lifeguard Equipment</a>
          <a href="hqstorge.html">HQ / Storge</a>
        </div>
      </div>
      <a href="about.html">About</a>
      <a href="index.html" >Home</a><br>
    </div>
    </div>
    <img src="images/logo.png"   style="max-width:100%" alt="branded">
    <a href="https://www.facebook.com/portsearescue" target="_blank"  style="margin-left: 13%;"></a>
    <a href="https://twitter.com/portsearescue" target="_blank" ></a>
    <a href="https://www.instagram.com/portsearescue/" target="_blank" ></a>
    <a href="https://smile.amazon.co.uk/ch/265431-0" target="_blank" ></a>
    <a href="https://charity.ebay.co.uk/charity/i/Portsmouth-&-Southsea-Voluntary-Lifeguards/167080" target="_blank" ><span style="color: #E53238;">e</span><span style="color :#0064D2;">b</span><span style="color: #F5AF02;">a</span><span style="color: #86B817;">y</span></a>
    <a href="https://www.paypal.com/uk/fundraiser/charity/3128890" target="_blank" > Donate to us &#10084; </a>
    <a href="https://www.justgiving.com/psvl" target="_blank" > Fundrise for us &#10047; </a>
  </header><br>
  <div >
    <p>As a voluntary lifeguard service, we rely solely on your kind donations to run and maintain our services.&nbsp;Any donation, big or small, is very much appreciated, and will help us to continue to save lives.</p>
  </div>
  <br><br>
  <a href="donate.html"><button  style="position: fixed; bottom: 10px; right: 10px;">Support us &#10084;</button></a>
</body>
</html>

The style used Bootstrap 5 as well

I'm at a lost here Many Thanks

CodePudding user response:

You have 2 viewport rules, so later overwrites previous one. You see more space because of different DPI of monitors.

Remove second viewport rule and leave only one with initial-scale=1

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="Portsmouth Lifeguards" />
        <link rel="shortcut icon" href="favicon.ico">
        ...

CodePudding user response:

There are two <meta viewport> in your HTML:

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width">

Remove the last one and see if it work.

  • Related