Menu icon Foundation
how to center an image with link

I'm trying to center a small logo image at the top of my email. 

However, if I do the following, the whole line will be clickable.

I only want the image part to be clickable. Is there anyway to solve it?

<center>
<a href="http://www.mileiq.com" target="_blank" title="MileIQ">
	
	<img src="http://emailpush.mileiq.netdna-cdn.com/relaunch2017/MileIQ-Logo.png" class="headerLogo" alt="MileIQ">
	
</a>
</center>

 

email;center;image;link;

I'm trying to center a small logo image at the top of my email. 

However, if I do the following, the whole line will be clickable.

I only want the image part to be clickable. Is there anyway to solve it?

<center>
<a href="http://www.mileiq.com" target="_blank" title="MileIQ">
	
	<img src="http://emailpush.mileiq.netdna-cdn.com/relaunch2017/MileIQ-Logo.png" class="headerLogo" alt="MileIQ">
	
</a>
</center>

 

Ryan Patterson 4 months ago

Wow, a center tag, haven't seen that in a long time. I thought that became deprecated in html4. 

If you are using foundation, just put .text-center on the parent container. That will horizontally center the image inside that parent container

So something like this:

<div class="text-center">
<a href="http://www.mileiq.com" target="_blank" title="MileIQ">
	
	<img src="http://emailpush.mileiq.netdna-cdn.com/relaunch2017/MileIQ-Logo.png" class="headerLogo" alt="MileIQ">
	
</a>
</div>

Again, this only works if using foundation. Other wise you can just apply text-align: center; to parent container.

Mustafa Emre Tekcam about 1 month ago

Ryan your answer helped me in my problem, but i wanted to know if there is a better way in doing this(Best Practice), as you mentioned that it is deprecated in HTML.

jessica brown about 1 month ago

Try these tags in the div. I am a developer at nursing essay writing service and can help you easily in this problem.

Apply text-align:center to that div.

 

<div style="width:100%;text-align:center;">
<a href="my/link"> <img src="my/image"> </a> <img src="my/image"/>
</div>

 

lionel john 15 days ago

Thank you so much for the information as I have been searching for this for past two days. I am dealing with one project right now and which needs the same feature. If possible please share more steps. river ranch resort cabin rental

Julia Roberts 15 days ago

If you want to centre your image with a link then try these lines.I have tried these lines on my cheapest essays website and it worked

<div style="text-align: center">
<a href="link">

<img src="URL" align="center"></a>
</div>

Taylor Shaw 3 days ago

I don't think it is supported in HTML anymore. But if you are persistent in making something like this I recommend foundation which is quite impressive with these sort of complex tasks. Hope you get a way around this problem soon. paristoursnow.com

Taylor Shaw 3 days ago

I don't think it is supported in HTML anymore. But if you are persistent in making something like this I recommend foundation which is quite impressive with these sort of complex tasks. Hope you get a way around this problem soon. paristoursnow.com