Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9021877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:21:41+00:00 2026-06-16T05:21:41+00:00

If I have an image in an anchor, how can I make the title

  • 0

If I have an image in an anchor, how can I make the title of the anchor appear, and not that of the image element?

I know I could remove the title attribute with javascript, but I’m hoping there is a simpler solution.

For example

<a title="Anchor Title"><img title="Image Title" /></a>

If you hover over the link, it will display “Image Title”.

What I’ve Tried

With CSS, I thought maybe I could change the z-indexes to push the anchor to the front, or maybe I could display the anchor as a block and give it the width and height of the image. This did not work. See JSFiddle here.

I was hoping to find a solution with CSS or maybe HTML.

The reason I want to do this is is that I’m working with WordPress, spitting out posts and thumbnails. I want the thumbnails to link to a certain page, and I want to have a universal title for the link, but it is taking the title from the individual thumbnails. Here’s the WordPress/PHP code:

<a href="<?php the_permalink(); ?>" title="Click to see Featured Stories">
<?php the_post_thumbnail(); ?>
</a>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:21:43+00:00Added an answer on June 16, 2026 at 5:21 am

    This offers a general solution, disregarding WordPress. CSS prevents the title to show up.

    HTML:

    <a title="Anchor Title">
        <img title="Image Title" src="http://codepen.io/images/logo.png" />
    </a>
    

    With CSS:

    a {
      display: inline-block;
    }
    
    img {
      pointer-events: none;
    }
    

    Result

    enter image description here

    See CodePen example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image tag enclosed in an anchor element like this: <a href='$image'><img
I have image map that can I move, but this map will be so
How can I make a SVG appear reliably without scrollbars in HTML? Something that
I have lots of anchor tags that each contain a thumbnail image: <a href=...
I have image Array with two images out of that first image its showing
i have a div that it have image content .i wanna implement animation when
I can not manage to have both i18n and tinyMCE widgets on internationalised fields.
I have a DIV that's wrapped in an anchor tag; all of the DIV
I know that I can do the following if I want to turn an
I have a button as an image... <img src=button.png /> I need some javascript

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.