Title: Center Image Link Problem
Last modified: August 21, 2016

---

# Center Image Link Problem

 *  [robin.resine](https://wordpress.org/support/users/robinresine/)
 * (@robinresine)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/center-image-link-problem/)
 * hi this is the page where there is the issue ( at the bottom of the page ) : 
   [http://resinemedia.net/ecoleescoulen/formations/formations-longues/](http://resinemedia.net/ecoleescoulen/formations/formations-longues/)
 * I tryed the alignleft and right, the image link is not a problem.
    But when I
   do an aligncenter the link takes the full width of the page, I tryed doing that
   on other pages, and it does the same thing. I also just saw that the link takes
   the full width of a widget as well when i do an align center in a widget). I 
   run the theme responsive in the 1.9.3.2 version instead of 1.9.3.3 because i’m
   actually trying to find all the added code in header.php/style.css to edit my
   child theme so I don’t lose my work. Do you think the fact i’m not running the
   latest version might be the problem ? I’ve been using this version for a couple
   of weeks and the problem has only starting occuring today.
 * Thank you for your help
    Robin

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/center-image-link-problem/#post-3957189)
 * What are you trying to do? Which image are you talking about?
 *  Thread Starter [robin.resine](https://wordpress.org/support/users/robinresine/)
 * (@robinresine)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/center-image-link-problem/#post-3957206)
 * I’m trying to have my image with a correct link on hover, if you check the hover
   for the alignleft and alignright image, there is no problem, but for the aligncenter,
   the image link on hover takes the full page width.
    Which could be “ok” (not 
   really), but i’m rather picky for this and I would like the link to be only on
   the image itself, not the page background. I think it might be a problem with
   the theme not being updated, or it might be a problem with an aligncenter css
   code, or link aligncenter code, but I’m not enough experienced to go there and
   find the solution.
 * Thanks for taking time to help me out
    Robin
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/center-image-link-problem/#post-3957209)
 * That image is inside a paragraph – which is, by default, full width:
 *     ```
       <p style="text-align: center;">
       ```
   
 * The other images are in paragraphs as well – which really isn’t ideal.
 * Using inline CSS isn’t a great way to approach layout – it’d be better to simply
   put those images in divs and position them using external CSS.
 * BTW, you also should not be using tables for layout purposes – that’s quite outdated
   and not good practice.
 *  Thread Starter [robin.resine](https://wordpress.org/support/users/robinresine/)
 * (@robinresine)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/center-image-link-problem/#post-3957221)
 * Thank you very much, i will do the code tomorrow, and for the tables, I don’t
   use them exept for ordering images, this text will probably be modified I didn’t
   write it.
    Thank you very much for the help =) Robin
 *  Thread Starter [robin.resine](https://wordpress.org/support/users/robinresine/)
 * (@robinresine)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/center-image-link-problem/#post-3957307)
 * I actually followed your instruction, but even by changing the code like so :
   from (which is the WP usual insert image code) :
 * > `<p style="text-align: center;"><a href="http://resinemedia.net/ecoleescoulen/
   > accueil/inscription/"><img class="aligncenter size-full wp-image-1291" alt="
   > bouton-2" src="http://resinemedia.net/ecoleescoulen/wp-content/uploads/2013/
   > 06/bouton-2-e1374658687624.png" width="196" height="147" /></a></p>`
 * to :
 * > `<a href="http://resinemedia.net/ecoleescoulen/accueil/inscription/"><img class
   > ="aligncenter size-full wp-image-1291" alt="bouton-2" src="http://resinemedia.
   > net/ecoleescoulen/wp-content/uploads/2013/06/bouton-2-e1374658687624.png" width
   > ="196" height="147" /></a>`
 * what should i modify to have it work, since the alignment doesn’t seem to be 
   a problem but the link area seems to work weirdly, I think it may either be a
   plugin confligt or something wrong in the code, but I have really no clue.
    Thank
   you for your help Robin
 *  [Ben Sibley](https://wordpress.org/support/users/bensibley/)
 * (@bensibley)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/center-image-link-problem/#post-3957320)
 * Robin,
 * Your image has the following CSS properties:
 *     ```
       margin-left: auto;
       margin-right: auto;
       display: block;
       ```
   
 * Remove both the margin properties and set the display to inline-block:
 * `display: inline-block;`
 *  Thread Starter [robin.resine](https://wordpress.org/support/users/robinresine/)
 * (@robinresine)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/center-image-link-problem/#post-3957322)
 * Hi Ben, thanks for your help but I think that this code is suposed to change 
   something for the aligncenter ? That actually didn’t change anything for the 
   link itself, the align center is working correctly but the problem is the link
   being full width ( going out of the image it self, when I do an aligncenter )
   
   Do you have any clue to solve this ? I find it really weird being the only one
   to actually have this issue ( maybe not, but none of the solutions seem to work
   yet, btw didn’t do the latest 3.6 WP update, i’ll be waiting for my main plugins
   to update before I do so. ) Hope to find a solution soon, trying to find something
   in the style.css with out any solutions yet. Thank you again Robin
 *  [Ben Sibley](https://wordpress.org/support/users/bensibley/)
 * (@bensibley)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/center-image-link-problem/#post-3957331)
 * Robin,
 * It looks like you figured it out, but I saw there’s still a bit of clickable 
   area above and below the image. If you want to get rid of that just take your
   image out of the <p> tags and put it into <div> tags.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Center Image Link Problem’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/responsive/6.3.8/screenshot.png)
 * Responsive
 * [Support Threads](https://wordpress.org/support/theme/responsive/)
 * [Active Topics](https://wordpress.org/support/theme/responsive/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/responsive/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/responsive/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [Ben Sibley](https://wordpress.org/support/users/bensibley/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/center-image-link-problem/#post-3957331)
 * Status: not resolved