Need help with photo in Tribute Page project

I am wondering if someone could help me with my photo in the tribute page project.

Clicking my photo will take you to a link which gives credit for the photo. I got it from Wikipedia Commons and they had code there I copied and added to my codepen. When I move the photo to the center of the page (using margin: 0 auto; in CSS) it makes most of the area on the left and right of the photo a hyperlink as well.

How can I make only the photo the hyperlink? Is there a better way to center the photo than how I did it?

Thank you so much for your time.

EDIT: I forgot the codepen ><

Could you post the codepen link?

Yikes, I forgot. Thank you

Try adding these styles to the image’s parent <a> element:

display: inline-block;
margin: 0 auto;

That worked! Thank you so much.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.