I'm struggling to make the image fit the entire screen on a mobile device using the code below. Interestingly, it displays correctly on my personal computer.
#topContainer {
height:1048px;
width: 100%;
padding: 0;
margin: 0;
}
#div1 {
background-image: url("images/Healthy-Eating.png");
height:1048px;
margin: 0;
background-size:cover;
position: relative;
padding-top: 40px;
}
#freeEbook {
background-color: rgba(0, 0, 0, 0.6);
height: 750px;
width: 535px;
border-bottom: 0px;
transition: background-color .5s ease 0s;
position: absolute;
color: #fff;
font-size: 1em;
padding: 10px;
}
Could you please help me understand why this is happening and suggest how I can rectify it?