I have encountered a dilemma while constructing a website. The top image on the site does not expand to fill 100% of the screen size on mobile devices, leaving a blank bar visible. Despite my extensive research and troubleshooting efforts, I have been unable to find a solution.
This layout is not responsive and only caters to mobile screens. Below, you will find a screenshot of the site along with a snippet of the code.
If you wish to visit the website, you can do so by following this link:
body {
margin: 0 auto;
padding: 0 auto;
font-family: 'Noto Sans', sans-serif;
}
h1 {
font-size: 5.0em;
color: #efc500;
}
h3 {
font-size: 2.5em;
color: #000000;
font-weight: normal;
font-style: italic;
}
h4 {
font-size: 1.5em;
color: #000000;
font-weight: normal;
position: relative;
bottom: 25px;
}
#bgmain {
background: url(img/main.jpg) no-repeat;
background-color: #efc500;
background-position: center center;
background-attachment: fixed;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-ms-background-size: cover;
-o-background-size: cover;
margin: 0 auto;
padding: 0 auto;
width: 100%;
height: 100%;
}
#barra {
height: 130px;
width: 100%;
background-color: white;
opacity: 0.8;
filter: alpha(opacity=80%);
}
#logo {
float: left;
margin-left: 5px;
}
#menu ul {
margin: 0px auto;
margin-top: 50px;
list-style: none;
float: right;
margin-right: 5px;
}
#menu ul li {
display: inline;
}
#menu ul li a {
font-size: 18px;
color: #efc500;
font-weight: bold;
margin-left: 30px;
text-decoration: none;
}
#menu ul li a:hover {
border-bottom: 6px solid #efc500;
}
#textomiddle {
width: 1050px;
margin: 0 auto;
margin-top: 150px;
}
#botao {
margin-left: auto;
margin-right: auto;
text-align: center;
width: 350px;
height: 70px;
display: block;
text-align: center;
margin-bottom: 30px;
background-color: #FFFFFF;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
opacity: 0.8;
filter: alpha(opacity=80%);
}
#botao:hover {
background-color: #FFFFFF;
opacity: 1;
filter: alpha(opacity=100%);
}
a.link {
text-decoration: none;
display: inline-block;
color: #efc500;
font-family: 'Noto Sans', sans-serif;
margin-top: 17px;
font-size: 25px;
}
<link href="https://fonts.googleapis.com/css?family=Noto+Sans:400,400i,700" rel="stylesheet">
<div id="bgmain">
<!-- THIS IS THE MAIN DIV FOR THE BACKGROUND IMAGE-->
<!-- -->
<div id="barra">
<!-- THIS IS THE WHITE BAR ON TOP OF WEBSITE-->
<div id="logo">
<!--THIS IS THE LOGO ON TOP LEFT -->
<img class="logo" src="img/cr6logo.png" alt="logo">
</div>
<!-- DIV LOGO END-->
<nav id="menu">
<!-- THIS IS THE MENU -->
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">NOSSOS TRABALHOS</a></li>
<li><a href="#">QUEM SOMOS</a></li>
<li><a href="#">CONTATO</a></li>
</ul>
</nav>
<!-- MENU END-->
</div>
<!-- BARRA END -->
<div id="textomiddle">
<!-- This is the DIV that stays in the dima of the banner -->
<center>
<h1>SOLUÇÃO COMPLETA EM ARQUITETURA</h1>
</center>
<div id="botao">
<center><a class="link" href="contato.html">FAÇA UM ORÇAMENTO</a></center>
</div>
</div>
<!-- END DIV TEXTOMIDDLE -->
</div>
<!-- END DIV BGMAIN-->