twitter-bootstrap: how to get rid of underlined button text when hovering over a btn-group within an a -tag?
{ text-decoration: none !important}
EDIT 1:
For you example only a{text-decoration: none}
will works
You can use a class not to interfere with the default behaviour of <a>
tags.
<a href="#" class="nounderline">
<div class="btn-group">
<button class="btn">Text</button>
<button class="btn">Text</button>
</div>
</a>
CSS:
.nounderline {
text-decoration: none !important
}
I want to remove Underline in Bootstrap Link
.links {
text-decoration: none;
}
<Link className={`links`} to={`/panelmember/${item._id}`}>
<Card.Title as="h2">
<strong>{item.name}</strong>
</Card.Title>
</Link>
Bootstrap 5 underline default changed?
Yes, As of Bootstrap 5 alpha1 the migration docs state:
"Links are underlined by default (not just on hover), unless they’re part of specific components"
You could create a special class like this:
.text-underline-hover {
text-decoration: none;
}
.text-underline-hover:hover {
text-decoration: underline;
}
<a href="#" class="text-underline-hover">Link</a>
Demo
Or, if you want it to apply to all anchors except for those that contain a class=
attribute use:
a:not([class]) {
text-decoration: none;
}
a:not([class]):hover {
text-decoration: underline;
}
This will not effect btn
, only links without class
will underline on hover.
a tag without line-decoration in Bootstrap 4
There are several Bootstrap 4 classes that set text-decoration: none
. Without knowing the semantic context of the link, I suggest you use the .btn
class...
<a href="#" class="text-dark btn">a tag with text-dark class and css to disable underline on hover</a>
https://www.codeply.com/go/CIt6zI0Iqw
However, there may be a class that works better semantically such as nav-link
(inside nav), card-link
(inside cards), or .breadcrumb-item
. Also, note that Bootstrap 4 only applies the underline to anchor links with the href=""
attribute. A simple anchor anchor will not have an underline on hover.
Related Topics
Font Smoothing Techniques? Text-Shadow Rendering Differently in Chrome 14.0.833.0 or Higher
Make Second Div Appear Above First, Without Absolute Position or Changing HTML
How to Create a CSS3 Gradient in Opera
How to Hide Default Choose File Button
Height: 100Vh; and Overflow "Content" on Smaller Screens
Hiding Table Data Using <Div Style="Display:None">
What Does an Asterisk Before an Equal Sign Mean (*=) ? What About the Exclamation Mark
How to Change Background-Color on Text Links on Hover But Not Image Links
Ordering Wordpress Stylesheets
How to Add Background Images in a Jsf Application Using Richfaces and CSS
How to Center Variable Width Divs in CSS
Stretch a Background Image in IE8
What's the Difference Between a Block-Level Box and a Principal Block-Level Box
Smart Way to Add Corner Image to Div Border on All Four Corners
CSS - Position: Absolute; - Auto Height