2016-12-05 4 views
0

私のフッターでは、フッターのイメージとボトムボーダーの間の空きスペースを削除できません。フッター内の空きスペースを削除するにはどうすればよいですか?

誰でも手伝ってもらえますか? のように、<footer>

.news-footer { 
 
    border-style: solid; 
 
    bottom: 0; 
 
    left: 0; 
 
\t 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>

+0

画像クラス表示設定:ブロック。マージン:0 auto;幅:100%;高さ:自動; これにより、画像も応答しやすくなります。 [https://jsfiddle.net/wkncsxq9/] –

答えて

2

display:blockを使用できます。

flexboxのような別の方法は、すべてのブラウザと互換性がありません。

IEでは、接頭辞-msが必要です。詳細はhereまたは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>

1

使用display: flex;(問題を理解するためにスニペットを参照してください):

.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>

footer { 
    display: flex; 
} 

以下のスニペットを見てください

1

display: blockであなたのイメージを設定します。

.news-footer { 
 
    border-style: solid; 
 
    bottom: 0; 
 
    left: 0; 
 
\t 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>

関連する問題