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 6029907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:57:26+00:00 2026-05-23T04:57:26+00:00

I have a link like: HTML: <a href=# title=> <img src=stack.png alt= title= />

  • 0

I have a link like:

HTML:

<a href="#" title=""> <img src="stack.png" alt="" title="" /> stackoverflow </a> 

CSS:

a { text-decoration: underline}

I want to remove the underline from the image.

I tried:

a img {text-decoration:none} 

But it not works.

BS:
I can do that if I added a display:block to img but that can cause a damage for the rest of the site, also I won’t add a specific class for this section.

Could I do that with jQuery?

  • 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-05-23T04:57:27+00:00Added an answer on May 23, 2026 at 4:57 am

    You should do this with CSS.

    You could add an inline style to that link:

    <a href="#" style="text-decoration:none;"> <img src=...etc /> stackoverflow </a>
    

    Or you could add a class to that link:

    <a href="#" title="" class="img"> <img src=...etc. /> stackoverflow </a>
    
    In your css...
    
    a.img {text-decoration:none;}
    

    EDIT:

    If you cannot alter the html, then use jQuery:

    $('a img').parent().css('textDecoration','none')
    

    (This is similar to what is above, but targets the parent of the img — that is the a — and then changes the style appropriately.)

    Fiddle http://jsfiddle.net/jasongennaro/vM55K/

    EDIT 2:

    If that is the only child element in an a, you could use this:

     $('a').children().css('textDecoration','none')
    

    Fiddle http://jsfiddle.net/jasongennaro/vM55K/1/

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

Sidebar

Related Questions

I have this code: <ul> <li> <h3><a class=title href=page1.html>Post Title</a></h3> <ul> <li> <img src=imageOne.png
I have HTML code like this : <div> <a>Link A1</a> <a>Link A2</a> <a>Link A3</a>
I have some markup like this: <p><a id=1 href=#>Link 1</a></p> <p id=1show class=starthidden>Hi! I
I use html attribute title to set some hints like this: <a href... title=Go
I have an HTML snippet like this : <a href=XXXXXXXXXXXXXXX target=_blank class=view_job_link>View or apply
I have a link that I dynamically create which looks something like the following:
I have found some info on the subject ( like this link) , but
I have a section: \section{Introduction} \label{sec:introduction} I'd like a link to the section where
I have a custom feature, and I'd like to link to that functionality from
function dlLink(title, currentArray, currentIndex, currentOpts) { var img = new Image(); img.src = 'Gallery/Wallpapers/'

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.