Link has underline even with text-decoration: none !important

I am working on a project for a friend. They use Material Design Bootstrap for their site. Its currently behind a wall, otherwise I would just show you the issue. The problem is the dropdown menu appears to display an underline as part of the links, this does not appear to happen on the mdbootstrap.com site though. I've even added text-decoration: none !important; as part of the styles on the achor element.
<a class="dropdown-item" href="/u/rmcintosh" style="
text-decoration: none !important;
">My profile</a>
<a class="dropdown-item" href="/u/rmcintosh" style="
text-decoration: none !important;
">My profile</a>
I've included an image of all of the computed styles as according to the browser. I've also included a picture of the Element in the dev console to show it does not have an :after that might be adding it. The weird thing is, I can do text-decoration-line: overline; and I will get both the underline and overline?
No description
No description
No description
No description
12 Replies
ἔρως
ἔρως6d ago
maybe the text decoration is on the <li> or <ul> wait you have invalid html your <li> is inside a <u>
Mouse0270
Mouse0270OP6d ago
OH MY GOD I CANT SPELL
ἔρως
ἔρως6d ago
you want to change it to <ul> <u> is the underline element that's why you can't get rid of the underline
Mouse0270
Mouse0270OP6d ago
I would have lost my mind and never found that stupid spelling mistake I love you with all my heart. haha
ἔρως
ἔρως6d ago
i only caught by chance
Mouse0270
Mouse0270OP6d ago
thank you so much, I have been staring at this for like 45 minutes I was getting to the point where pulling my hair out seemed reasonable. haha
ἔρως
ἔρως6d ago
🤣 confirmation bias is a damn hell of a drug you read <ul> because you expected <ul> but it was <u> all this time i read <ul> at first too
Mouse0270
Mouse0270OP6d ago
Pretty much. Sometimes you just need a second pair of eyes. Its why I tried to post screen shots of everything possible related since I couldn't share the code itself easily.
ἔρως
ἔρως6d ago
well, putting the chunk you think has issues on codepen or jsfiddle would let you catch this mistake easily you would see the underline if you didn't put any css and it wouldn't look like a list
Mouse0270
Mouse0270OP6d ago
Thats good advice, I will remember that next time.
ἔρως
ἔρως6d ago
the idea of it is to try to reproduce the bug with as little code as possible, and then you can share the codepen or jsfiddle but hey, the screenshots were enough
13eck
13eck6d ago
I'm glad you got it fixed before your lucious locks were in any real danger!

Did you find this page helpful?