Support » Fixing WordPress » How to have underline for a link with onmouseover function

  • I made some experiments, and I put “text-decoration:none” in the style section of links in tinymce to eliminate the fixed underline with links, and it works. But I’d also want the underline effect when I mouseover on a link. What code should I put in the onmouseover section? I tried a lot of things, but nothing 🙁

Viewing 7 replies - 1 through 7 (of 7 total)
  • esmi

    (@esmi)

    Forum Moderator

    Try text-decoration:underline;

    Tried already, no results 🙁

    By the way, the url: elsatrento.org

    esmi

    (@esmi)

    Forum Moderator

    Is this to remove/add underlines in TimyMCE or on the displayed site. If it’s the latter, you need to edit your theme’s stylesheet.

    What do you mean with “displayed site”? Anyway, I want this effect for a text widget, that’s why I compose the text in tinymce and then I copy the html and past it in the text widget. It works very well, but with “onmouseover” I don’t know what to write 🙁

    esmi

    (@esmi)

    Forum Moderator

    You’d be better off applying a class to the links in your Text widget and than adding that class to your theme’s stylesheet.

    As esmi said, give your links(or the containing element) a class, then apply CSS to the links..

    Here’s an example you can use..

    Example HTML: Code that would go in the widget

    <div class="mydiv">
      <a href="#example">Example link 1</a>
      <a href="#example">Example link 2</a>
    </div>

    Example CSS: Code that would go into your stylesheet

    .mydiv a { text-decoration:none }
    .mydiv a:hover { text-decoration:underline }

    Seems too much complicated for my goals. Thanks anyway 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to have underline for a link with onmouseover function’ is closed to new replies.