Why is the margin space of my image link clickable?

后端 未结 3 1497
离开以前
离开以前 2020-12-15 05:35

I am building a website for a friend, and part of his specification is that images should include links to view the image in a higher resolution. I enclosed the home image i

3条回答
  •  有刺的猬
    2020-12-15 05:58

    It's because you have an img using display: block inside an a tag, which is inline.

    Move the width: 60% and margin: 0 auto; to the a tag with display: block and add width: 100% to img

    Example: http://jsfiddle.net/9kSL3/6/

提交回复
热议问题