からマージンを排除する必要性私はこのJSFiddleを持っている:https://jsfiddle.net/96urhqcz/マージン - リンク領域
4列のdivがあります - HTMLは次のようになります。
<div class="g-1-4 app">
<a style="text-decoration:none;" href="https://link1/">
<div style="margin:10px; padding: 30px 0px; background:#E74C3C" class="app">
<i class="fa fa-3x fa-comments-o" width="50%" style="display:block; margin:auto" src="/static/launcher/comments-o"></i>
Link Number 1
</div>
</a>
</div>
<div class="g-1-4 app">
<a style="text-decoration:none;" href="https://link2/">
<div style="margin:10px; padding: 30px 0px; background:#9D55B8" class="app">
<i class="fa fa-3x fa-paper-plane" width="50%" style="display:block; margin:auto" src="/static/launcher/paper-plane"></i>
Link Number 2
</div>
</a>
</div>
<div class="g-1-4 app">
<a style="text-decoration:none;" href="https://link3/">
<div style="margin:10px; padding: 30px 0px; background:#3395DD" class="app">
<i class="fa fa-3x fa-street-view" width="50%" style="display:block; margin:auto" src="/static/launcher/street-view"></i>
Link 3
</div>
</a>
</div>
<div class="g-1-4 app">
<a style="text-decoration:none;" href="https://link4/">
<div style="margin:10px; padding: 30px 0px; background:#00838F" class="app">
<i class="fa fa-3x fa-line-chart" width="50%" style="display:block; margin:auto" src="/static/launcher/line-chart"></i>
Link 4
</div>
</a>
</div>
CSSについては、 G-1-4のようになります。
.g-1-4{
width: 25%;
}
あなたがJSFiddleで見ることができるように - ボックス間のマージンを適切なボックスに「リンク」されています。
最終的に私は4層レイアウトをしようとしていますが、余白はではなくにリンクされています。ユーザーがボックスの間にマウスを置くと、クリック可能でない通常のマウスになります。
私はそれが本当にシンプルなものだと確信しています - しかし、私はそれを修正するように見えることはできません。
ご意見やご提案はありますか?
あなたの問題は、あなたがあなたのリンクは「本物」のdivの周りに費やしている理由である左右、上のパディングを持っているということです。パディングの代わりにマージンを使用することを検討してください。 –
私は縁の周りに10pxのマージンを持っていますが、それは違いはありません(マージンを広げ、パディングを減らす - マージン領域はまだリンクされています)。 – Hanny