Ruan
Ruan

Reputation: 45

Website responsive tags working on apple devices but not on andriod

My website responsive works on my iPhone 100% but for some reason it messes up on android devices...

I've already got bootstrap integrated with it's suggested responsive string.

How it should look: http://prntscr.com/p4szot <-- iPhone

The main problem: http://prntscr.com/p4szg4 <-- Android

  1. I've installed bootstrap and it's responsive strings.
  2. I've added the style property word-break: break-all;
<html lang="en">
    <head>
        <title>Semix | Cheap Website Development</title>

        <!--Font awsome---------------------------------------------------------------------------------->
        <script src="https://kit.fontawesome.com/3c0298f6a8.js"></script>
        <!--Google Fonts--------------------------------------------------------------------------------->
        <link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
        <!--Stylesheet----------------------------------------------------------------------------------->
        <link rel=stylesheet href="style.css" type="text/css" media="screen">
        <!--Bootstrap------------------------------------------------------------------------------------>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        </head>
    <body>






      <div class="container">
          <nav>
            <input type="checkbox" id="nav" class="hidden">
            <label for="nav" class="nav-btn">
              <i></i>
              <i></i>
              <i></i>
            </label>
            <div class="logo">
              <img class="logo" src="images/logow.png">
            </div>
            <div class="nav-wrapper">
              <ul>
                  <li><a class="active"href="index.html">Home</a></li>
                  <li><a href="pricing.html">Pricing</a></li>
                  <li><a href="faq.html">faq</a></li>
                  <li><a href="contact.html">Contact</a></li>
              </ul>
            </div>
          </nav>
      </div>

<!--TODO Header Content-->
        <div class="header">
              <h1>Website development<br> made easy</h1>
              <h3>Not just a business but a reliable business partner</h3>
              <button type="button" class="button button-1">get started</button>
              <button type="button" class="button button-2">get a quote</button>
        </div>


<!-- TODO Sub Content-->
        <div class="sub-content">
          <h2>Professional website development</h2>
          <p>Semix is a professional website & graphics development company based in South Africa, we can offer modern creative and responsive designs to best suit your needs.</p>
        </div>

<!--TODO Services-->

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
      </body>
      <div class="services-section">
          <div class="inner-width">
            <h1 class="section-title">Our Services</h1>
            <div class="border"></div>
            <div class="services-container">

              <div class="service-box">
                <div class="service-icon">
                  <i class="fas fa-wrench"></i>
                </div>
                <div class="service-title">Technical Support</div>
                <div class="service-desc">
                    Problem with your site? Hosting? We will help you setup your site with the correct hosting plans and domain registration
                </div>
              </div>

              <div class="service-box">
                <div class="service-icon">
                  <i class="fas fa-code"></i>
                </div>
                <div class="service-title">Web Development</div>
                <div class="service-desc">
                    We create beautiful and functional websites with responsive designs to ensure our work looks great on any device
                </div>
              </div>

              <div class="service-box">
                <div class="service-icon">
                  <i class="fas fa-brush"></i>
                </div>
                <div class="service-title">Live chat / email</div>
                <div class="service-desc">
                    Make sure your business never sleeps by integrating a contact form and live chat with automatic replies to your amazing site 
                </div>
              </div>

              <div class="service-box">
                <div class="service-icon">
                  <i class="fas fa-headset"></i>
                </div>
                <div class="service-title">Support</div>
                <div class="service-desc">
                    We have amazing support to make sure we can help you in any way possible

                </div>
              </div>

              <div class="service-box">
                <div class="service-icon">
                    <i class="fab fa-searchengin"></i>
                </div>
                <div class="service-title">SEO</div>
                <div class="service-desc">
                    Search Engine Optimization, make sure your website is being discovered and displayed on Google search results

                </div>
              </div>

              <div class="service-box">
                <div class="service-icon">
                    <i class="fas fa-file-code"></i>
                </div>
                <div class="service-title">Custom Work</div>
                <div class="service-desc">
                  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Et eaque ratione rem porro, nihil.
                </div>
              </div>
            </div>
          </div>
        </div>


<!--TODO button section-->
<div class="button-section">
  <button type="button" class="button button-3">Start Your Project</button>
</div>

<div class="footer">
  <p>&copy Copyright Semix 2019</p>


  <div class="footer-nav">
    <a href="#">Legal</a>|
    <a href="#">Terms</a>|
    <a href="#">FAQ</a>|
    <a href="#">Contact</a>
  </div>


  <h2>Semix</h2> <img src="images/south-africa.png" alt="sa-logo">

</div>



</html>

body {
    font-family: 'Open sans', sans-serif;
    height: 100%;
    margin: 0;
    background: url(images/main-background-header.png);
    background-position: center;
  background-color: black;
    background-repeat: no-repeat;
}
html{
    height: 100%;
    margin: 0;
    padding: 0;
    width: 100%,
}
*{
    margin:0;
    padding:0;
    box-sizing: border-box;
    word-break: break-all;
  }

/*Header*/
.image{
        background-position: center;
        height: calc(100% + 700px);
        width:100%;
        background-repeat: no-repeat;
        position: absolute;
        z-index:-1;
        top: -80px;
        text-align: center; 
    }
.header > h1{
    font-family: 'Open sansextra-bold', sans-serif;
    text-align: center;
    font-size: 60px;
    text-transform: uppercase;
    color: white;
}
.header > h3{
    font-family: 'Open sans', sans-serif;
    text-align: center;
    color: #828282;
}
.header{
    position:relative;
    text-align:center;
    color:white;
    padding:10px 0px;
    margin-top: 200px;
  }
.button {
    border: none;
    padding: 16px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 20px;
    text-transform: uppercase;
    -webkit-transition-duration: 0.4s;
    transition-duration: 0.4s;
    cursor: pointer;
    display: inline-block;
    flex-direction: column;
    justify-content: center;
    margin-top: 50px;
}
.button-1 {
    background-color: transparent;
    color: white;
    border: 3px solid white;
    text-align: center;
}
.button-2{
    background-color: #FF4E00;
    color: white;
    border: 3px solid #FF4E00;
}
.button-1:hover{
    background-color:white;
    color: black;
    border: 3px solid white;
}



/*Our Services Section*/

.services-section{
    background: url(images/services.jpg);
    background-size: cover;
    padding: 60px 0;
  }
  .inner-width{
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
    overflow: hidden;
  }
  .section-title{
    text-align: center;
    color: #ddd;
    text-transform: uppercase;
    font-size: 30px;
  }
  .border{
    width: 160px;
    height: 2px;
    background: #FF4E00;
    margin: 40px auto;
  }
  .services-container{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .service-box{
    max-width: 33.33%;
    padding: 10px;
    text-align: center;
    color: #ddd;
    cursor: pointer;
  }

  .service-icon{
    display: inline-block;
    width: 70px;
    height: 70px;
    border: 3px solid #FF4E00;
    color: #fff;
    transform: rotate(45deg);
    margin-bottom: 30px;
    margin-top: 16px;
    transition: 0.3s linear;
  }
  .service-icon i{
    line-height: 70px;
    transform: rotate(-45deg);
    font-size: 26px;
  }
  .service-box:hover .service-icon{
    background: #FF4E00;
    color: #ddd;
  }
  .service-title{
    font-size: 18px;
    text-transform: uppercase;
    margin-bottom: 10px;
  }
  .service-desc{
    font-size: 14px;
  }

  @media screen and (max-width:960px) {
    .service-box{
      max-width: 45%;
    }
  }

  @media screen and (max-width:768px) {
    .service-box{
      max-width: 50%;
    }
  }

  @media screen and (max-width:480px) {
    .service-box{
      max-width: 100%;
    }
  }




















/*NEW NAV*/

nav {
    padding: 8px;
    display: inline;
}
.logo {
    float: left;
    padding: 8px;
    margin-left: 16px;
    margin-top: 8px;
    width: 250px;
    height: 70px;
}
nav ul{
    float: right;
}
nav ul li {
    display: inline-block;

}

nav ul li:not(:first-child) {
    margin-left: 48px;
}
nav a.active{
    font-weight: bold;
    color: #FF4E00;
}

nav ul li:last-child {
    margin-right: 24px;
}

nav ul li a {
    display: inline-block;
    outline: none;
    color: white;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 15px;
}

@media screen and (max-width: 864px) {
    .logo {
          padding: 0;
          width: 100px;
          height: auto !important;
    }
    .header{
        margin-top: 100px;
    }
    .header h1{
      font-size: 20px;
    }
    .header h3{
      font-size: 17px;
    }
    .nav-wrapper {
          position: fixed;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          z-index: -1;
          background: #fff;
          opacity: 0;
          transition: all 0.2s ease;
    }

    .nav-wrapper ul {
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
          width: 100%;
    }

    .nav-wrapper ul li {
          display: block;
          float: none;
          width: 100%;
          text-align: right;
          margin-bottom: 10px;
    }

    .nav-wrapper ul li:nth-child(1) a {
          transition-delay: 0.2s;
    }

    .nav-wrapper ul li:nth-child(2) a {
          transition-delay: 0.3s;
    }

    .nav-wrapper ul li:nth-child(3) a {
          transition-delay: 0.4s;
    }

    .nav-wrapper ul li:nth-child(4) a {
          transition-delay: 0.5s;
    }
    .nav-wrapper ul li:nth-child(5) a {
        transition-delay: 0.6s;
  }

    .nav-wrapper ul li:not(:first-child) {
          margin-left: 0;
    }

    .nav-wrapper ul li a {
          padding: 10px 24px;
          opacity: 0;
          color: #000;
          font-size: 14px;
          font-weight: 600;
          letter-spacing: 1.2px;
          transform: translateX(-20px);
          transition: all 0.2s ease;
    }

    .nav-btn {
          position: fixed;
          right: 10px;
          top: 10px;
          display: block;
          width: 48px;
          height: 48px;
          cursor: pointer;
          z-index: 9999;
          border-radius: 50%;
    }

    .nav-btn i {
          display: block;
          width: 20px;
          height: 2px;
          background:white;
          border-radius: 2px;
          margin-left: 14px;
    }

    .nav-btn i:nth-child(1) {
          margin-top: 16px;
    }

    .nav-btn i:nth-child(2) {
          margin-top: 4px;
          opacity: 1;
    }

    .nav-btn i:nth-child(3) {
          margin-top: 4px;
    }
}

#nav:checked + .nav-btn {
    transform: rotate(45deg);
}

#nav:checked + .nav-btn i {
    background: #000;
    transition: transform 0.2s ease;
}

#nav:checked + .nav-btn i:nth-child(1) {
    transform: translateY(6px) rotate(180deg);
}

#nav:checked + .nav-btn i:nth-child(2) {
    opacity: 0;
}

#nav:checked + .nav-btn i:nth-child(3) {
    transform: translateY(-6px) rotate(90deg);
}

#nav:checked ~ .nav-wrapper {
    z-index: 9990;
    opacity: 1;
}

#nav:checked ~ .nav-wrapper ul li a {
    opacity: 1;
    transform: translateX(0);
}

.hidden {
    display: none;
}



.sub-content {
    background: #FF4E00;
    min-height: 200px;
    margin-top: 90px;
    text-align: center;
    position: relative;
    font-family: 'Open sans', sans-serif;
}


.sub-content h2{
    color: white;
    font-size: 30px;
    padding-top: 30px;
    text-transform: uppercase;

}
.sub-content p{
    color: white;
    padding-top: 30px;
}

.button-3 {
  background-color: white;
  color: black;
  border: 3px solid white;
  text-align: center;
  justify-content: center;
}
.button-3:hover {
  background-color: white;
  color: black;
  border: 3px solid rgb(209, 63, 0);
  text-align: center;
  justify-content: center;
}

.button-section{
  background-color: #FF4E00;
  justify-content: center;
  position:relative;
  text-align:center;
  padding-bottom: 50px;

}

.footer{
  background-color: #000;
  color: white;
  text-align: center;
  padding-top: 50px;
  padding-bottom: 50px;
}

.footer h2{
  padding-top: 30px;
}

.footer-nav {
  justify-content: center;
  text-align: center;
  padding-top: 20px;
}

.footer-nav a {
  text-decoration: none;
  color: white;
  padding: 20px;
  text-transform: uppercase;
}

@media screen and (max-width: 864px) {
  .sub-content h2{
    font-size: 20px;

  }
}

Upvotes: 0

Views: 104

Answers (1)

disinfor
disinfor

Reputation: 11558

The issue is that the <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> is in the wrong spot in your HTML.

This tag needs* to be one of the first tags inside the <head> and before the <title> tag and any CSS.

I believe this is because the meta tag is telling the browser how to interpret style properties that would come from @media queries (among other things).

Here is the spec: https://drafts.csswg.org/css-device-adapt/#viewport-meta

This offers some good info on what the browser should do with the tag, which may lead to some inference to why it behaves the way it does.

*Need documentation to support this vs. this is how it works without breaking.

Upvotes: 1

Related Questions