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

  • SEARCH
  • Home
  • 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 8086649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:31:09+00:00 2026-06-05T18:31:09+00:00

I have my span tag: <span style=text-decoration:line-through > Hello World <a href=http://www.yahoo.com>Yahoo</a> </span> As

  • 0

I have my span tag:

<span style="text-decoration:line-through" > Hello World <a href="http://www.yahoo.com">Yahoo</a> </span>

As you can see I have applied line-through on span. But this results in line-through on anchor tag too. How do I prevent line-through on anchor tag. I don’t want strike on my anchor tag.

Note: Please don’t ask me to move my anchor tag outside of span tag! If I could do that I wouldn’t be asking this question.

  • 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-05T18:31:11+00:00Added an answer on June 5, 2026 at 6:31 pm

    [From CSS text-decoration property cannot be overridden by child element ]

    text-decoration specs state:

    The ‘text-decoration’ property on descendant elements cannot have any
    effect on the decoration of the ancestor.

    text-decoration-skip, as mentioned in the linked question is supported by neither the latest version of Chrome, nor Firefox


    I don’t know if this is acceptable to you, but since the solution below doesn’t work, this might be your only way to do it:

    <span>
       <span class="strikethrough">Hello </span>
       <a href="#">World!</a>
    </span>​
    
    .strikethrough {
       text-decoration: line-through;
    }
    

    It is valid to nest span elements. Are nested span tags OK in XHTML?


    Doesn’t work:

    The property will be inherited by the child by default. If you do not want that, override it.

    span > a {
       text-decoration: none;
       /* or perhaps 
       text-decoration: underline;
       */
    }
    

    This will ensure all anchor elements that appear as a direct descendent of a span element will not have a strikethrough.

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

Sidebar

Related Questions

I've followed this tutorial and it works fine: http://www.dynamicdrive.com/style/csslibrary/item/css-popup-image-viewer/ However my problem is that
I have a javascript code that have span tag and inside the span tag
a I have some images on page and I want to put <span> tag
I have a span with the following style: margin: 5px 0; padding: 2px; cursor:
I have a span that is generated through javascript, with its css class as
I have an image inside a span tag, the span has a set width
I always thought that replacing the <center> tag with <div style=text-align:center;> will get me
I have implemented this Feature Content Slider: http://demo.webdeveloperplus.com/featured-content-slider/ There seems to be space between
i am using JSOUP and I have html/text something like: <html><head><style type=text/css> </style></head> <body><div
I have displayed one of sprite's image in span tag. The span is in

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.