• Hi all,

    I have set for all text to be underlined in my “a:link ” within the css file.

    I noticed that it means that anything linked via “a name” will be underlined as well. See:
    https://www.jennifersando.com/livien/index.php/archives/44

    Is there anyway I can specify for the “a name” references to not be underlined without impacting the underline style for all the normal “a” links?

    I hope this makes sense.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The only anchor tags that can be styled (that I’m aware of) are a, a:link, a:active, a:visited and a:hover.

    Normally, when people use this tag it’s to jump from one area of the page to another, and the opening and closing tags are usually back to back with no space in between that would be affected by underlining, e.g.

    <a name="gotothisparagraph"></a><h2>Featured Paragraph</h2>

    and so forth. How are you using this anchor tag?

    Anyway, to answer your question notwithstanding the above, you can designate a class, “name” that has no underlining, like this:

    a.name {
    text-decoration: none;
    }

    OR

    .name {
    text-decoration: none;
    }

    Then in instances where you want to invoke this style, do so like this:

    <a class="name" name="sometext"></a>

    Of course you can call the class anything you want if you don’t want to call it “name.”

    Thread Starter jayess

    (@jayess)

    Brilliant! Thanks for that, I have created a class called “name” as per your advice and it is solved! Thanks.

    Ok, there are better ways of going about this ??

    First, don’t use <a name> at all, how retro. Just put an id=”xx” on the element you want to target (eg. <p id="car-rel">) and you can link to it the same way as you would to the value of the name attribute.

    Anyway, to answer your question: take the text-decoration: underline rule from the a {} selector to the :link, :visited, :hover, and :active selectors.

    Thread Starter jayess

    (@jayess)

    Very good! And very happy that I got two responses containing resolutions just the same hehe.

    I have deleted the a class reference then; and ended up removing the text-decoration:underline from the a selector.

    The id= etc idea was a little too advanced for me! I’m just a writer ??

    Thank-you both!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘“A Name” – no underlining please!’ is closed to new replies.