0

In my footer I can't remove the empty space between image and bottom border of footer.

Can anyone help me? (See snippet for understand the problem)

.news-footer {
  border-style: solid;
  bottom: 0;
  left: 0;
 position: fixed;
  right: 0;
  
 }

.image-footer {
  height: 100%;
  width: 100%;
  
}
<footer class="news-footer">
<img class="image-footer" src="http://oi66.tinypic.com/wgwbpi.jpg" alt="Download App"/>
</footer>
Razia sultana
  • 2,168
  • 3
  • 15
  • 20
kilkus
  • 15
  • 1
  • 8
  • set the image class display:block; margin:0 auto; width:100%; height:auto; This make your image also responsive. [ https://jsfiddle.net/wkncsxq9/ ] – Baezid Mostafa Dec 05 '16 at 15:35

3 Answers3

2

You can use display:block.

Another method like flexbox is not compatible with all browsers.

In IE you need use -ms prefix. Learn more here or here.

.news-footer {
  border-style: solid;
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  
 }

.image-footer {
  height: 100%;
  width: 100%;
  display:block;
  
}
<footer class="news-footer">
<img class="image-footer" src="http://oi66.tinypic.com/wgwbpi.jpg" alt="Download App"/>
</footer>
Community
  • 1
  • 1
Olaf Erlandsen
  • 5,817
  • 9
  • 41
  • 73
1

Use display: flex; on <footer>, like:

footer {
  display: flex;
}

Have a look at the snippet below:

.news-footer {
  display: flex;
  border-style: solid;
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
 }

.image-footer {
  height: 100%;
  width: 100%; 
}
<footer class="news-footer">
<img class="image-footer" src="http://oi66.tinypic.com/wgwbpi.jpg" alt="Download App"/>
</footer>

Hope this helps!

Saurav Rastogi
  • 9,575
  • 3
  • 29
  • 41
1

Set your image with display: block.

.news-footer {
  border-style: solid;
  bottom: 0;
  left: 0;
 position: fixed;
  right: 0;
  
 }

.image-footer {
  height: 100%;
  width: 100%;
  display: block;
  
}
<footer class="news-footer">
<img class="image-footer" src="http://oi66.tinypic.com/wgwbpi.jpg" alt="Download App"/>
</footer>
Jordi Nebot
  • 3,355
  • 3
  • 27
  • 56