I have searched for quite a while and read many of the other answers on this topic. I have a set of image links for which the clickable areas overextend the images, but only on the bottom. The images are the social icons in the site header.
Website link: http://brendanbikes.org/
stylesheet: http://brendanbikes.org/wp-content/themes/casper-wp-master/style.css?ver=3.9.1
Relevant class: .social-icons
I’ve tried changing the float of the individual images, line height, div container height, all to no avail. Why do the links only overextend on the bottom, and how can I prevent this?
It’s caused by the default display of the
a
tags (display: inline;).Add this CSS, and everything will be OK :
You can’t change height and width of inline elements. By specifying
display: inline-block
, you can then adjust theheight
of your.social-icons a
objects:Add to
.social-icons a
rule:The solution is a bit hacky, but adding the following forces cutoff of anything outside the container, and accounts for horizontal cutoff:
Hope this helps others with this.