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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:33:39+00:00 2026-05-16T00:33:39+00:00

I’m trying to make this look pretty, but I’ve run into a problem. I

  • 0

I’m trying to make this look pretty, but I’ve run into a problem. I have a span element containing a Subtitle or short description inside the anchor tag. Unfortunately it’s styled the same way as the anchor, which is not how I want it to be. I’ve tried applying styling to the span itself but they seem to be overridden by the anchor styles. The problem is that I don’t want it to be underlined when the link is hovered over.

Here’s my html.

        <ul>
           <li><a href="#">A <span class="subTitle">Subtitle</span></a></li>
           <li><a href="#">B <span class="subTitle">Subtitle</span></a></li>
           <li><a href="#">C <span class="subTitle">Subtitle</span></a></li>
           <li><a href="#">D <span class="subTitle">Subtitle</span></a></li>
           <li><a href="#">E <span class="subTitle">Subtitle</span></a></li>
        </ul>

And my CSS

#leftNav ul li { position: relative; }
#leftNav ul li a span.subTitle
{
   bottom:          4px;
   color:           #000000;
   display:         block;
   font-size:       12px;
   left:            10px;
   position:        absolute;
   text-decoration: none;
}

I’ve tried styling the span itself, which doesn’t seem to have any effect. Placing the span outside the anchor, relative to the li doesn’t work either. the span blocks the hover event of the anchor and it isn’t clickable.

  • 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-16T00:33:40+00:00Added an answer on May 16, 2026 at 12:33 am

    A test of your sample code (adding in a suitable div with id around it) seems to work fine:

    http://jsfiddle.net/44ndf/1/

    Its default styling will of course be the same as the anchor so you will potentially need to override things back to normal. You’ll have to provide a working (or more accurately a not working) sample for us to be able to precisely narrow down where your problem lies.

    In conclusion though things to check include:

    1) That your selectors are definitely pointing to the correct elements (eg in the above I had to include a div with id “leftNav” to make the selector pick it up

    2) That you defintiely don’t have conflicting styles – possibly something with higher precedence or possibly something with a !important overriding it.

    3) Use Firebug to see exactly which styles are being applied from which CSS selectors to identify where your problems lie.

    Edit:

    In the case of the underline it seems that it is impossible (or at least no way I’ve found) to override the a styling. So instead I changed the markup around a bit:

    http://jsfiddle.net/44ndf/2/

    <a href="#"><span>A </span><span class="subTitle">Subtitle</span></a>
    

    With this markup you can set styles as follows:

    #leftNav ul li a span.subTitle
    {
        text-decoration: none;
    }
    
    #leftNav ul li a span
    {
     text-decoration: underline;   
    }
    
    #leftNav ul li a
    {
     text-decoration: none;  
    }
    

    This basically tells the anchor not to have underlines. All spans to have underlines and then your subtitle span not to have underlines. You will need to obviously make sure that everythign that wants underlining is in a span (anything not in a span won’t be underlined).

    For what its worth it looks like a browser bug to me since IE seems to behave well – http://jsfiddle.net/44ndf/5/ has no underline on the subtitles on IE but does on firefox. I suspect there is somethign special abotu the underlines from anchors not being overridden.

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

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.