So, I have an image and a black line,both of them width is 100%. But for some reason the image height size isn't 100%,and I have some little white space between the two element. This is what I want to fix,so I don't want that space there,and the image should stay responsive (mobile friendly)
Can someone tell me what I did wrong?
I think I used a wrong div structure for responsivility,I'm still a beginner in this.
Here is the code:
* {
margin:0;
padding:0;
}
img {
width:100%;
}
.blackLine {
display: block;
width: 100%;
height: 70px;
background-color: #000000;
}
<img src="https://www.pacificenvironment.org/wp-content/uploads/2016/11/hong-kong-china-skyline-720P-wallpaper-1920x300.jpg" alt="Image">
<div class="blackLine">
</div>