I have a really simple question (and I even know the reason of why it's happening) but I cannot get it to translate into my code. A brainfart I'm sure, but one I can't seem to shake so I need some help on.
I have an image within an anchor that I wanted centered on my screen. I only want the image clickable, but the whole div is currently clickable and it points to my image. I'm sure it's because a elements are inherently inline, and my image is set to a block (fr centering purposes) and therefore the whole div becomes clickable for the image. But nothing will allow me to alter my code to keep it centered and only have the img clickable rather than the whole div. I tried setting the margin in the , and the display in the float (among other things) with no luck. Any idea where my problem is occuring? Thanks!
HTML:
<div class ="resume">
<p><h2>View Resume:</h2></p>
<a href="assets/res.pdf" class="fancybox fancybox.iframe" title="My Resume"><img src="assets/res_preview2.jpg" /></a><br>
</div>
CSS:
.resume img{
display: block;
margin: 15px auto;
box-shadow: 2px 2px 18px #232323;
}
.resume h2{
font-size: 2em;
font-weight: 700;
text-align: center;
display: block;
}
NOTE: Using fancybox for a PDF to use as an iframe - the problem is with the jpg.