<a href="/admin/menu_bars/select">
<div cl开发者_如何学Goass="action_box right">
Manage Menu Bars
</div>
</a>
a .action_box {
text-decoration: none;
}
doesn't work =\
Your code is trying to remove the underline from the div (which probably doesn't have one) rather than the link (which probably does). Simply
a {
text-decoration: none;
}
will work, although that will remove the underline from all links.
If you need to be more specific to that link then use
<a class="action_link" href="/admin/menu_bars/select">
<div class="action_box right">
Manage Menu Bars
</div>
</a>
a.action_link {
text-decoration: none;
}
This assumes that the underline is in fact a text-decoration
on the link element and not a border-bottom
on the div.
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>
Problem is, it's not putting the underline under the text, it's underlining the div. Basically you'd need to define the rule at the anchor still, not for the content inside the anchor:
a, a .action_box { text-decoration: none; }
It quite possibly could be an issue of another class / property is overriding your latest attempt; however, try what Silence Dogood said:
a div .action_box {
text-decoration: none;
}
If that doesn't work we'll need to see the rest of the CSS.
Can you not just use this.
#content > ul {
text-decoration: none;
}
The above obviously is my own.
You are trying to remove underline from div which is inside the anchor tag
Simply use
a{
text-decoration: none;
}
You can give id to anchor tag for better use,
<a id="linkid" href="/admin/menu_bars/select">
<div class="action_box right">
Manage Menu Bars
</div>
</a>
and use css
a#linkid{
text-decoration: none;
}
精彩评论