Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: how do I remove the underline from a link that isn't directly in the anchor tag?

Tags:

css

<a href="/admin/menu_bars/select">
    <div class="action_box right">
        Manage Menu Bars
    </div>
</a>


a .action_box {
text-decoration: none;
}

doesn't work =\

like image 669
NullVoxPopuli Avatar asked Mar 05 '11 22:03

NullVoxPopuli


People also ask

How do I remove the underline from a purple link in CSS?

A purple link can be removed by overriding the default link styles in CSS. Specifically, a purple link indicates that the link has already been visited. So in order to change this style we must change the CSS :visited pseudo class.


1 Answers

You still need to apply the text-decoration style to the outer href tag.

Example follows:

<html>
    <head>
        <style>
        .noUnderline {
        text-decoration: none;
        }
        </style>
    </head>
  <body>
    <a class="noUnderline" href="/admin/menu_bars/select">
        <div class="action_box">
            Manage Menu Bars
        </div>
    </a>
</body>
</html>
like image 170
iwalkbarefoot Avatar answered Oct 04 '22 20:10

iwalkbarefoot