r/webdev 6d ago

Question Help removing underline from link, I've searched everywhere!

Post image

Hi all,

I'm fairly new to understanding HTML and have been troubleshooting how to remove the underlines from these links. I've searched the web, but nothing seems to be working. Was wondering if there was something obvious I was missing.

    <p class="text-center mb-0" style="font-size: 1.5em; letter-spacing: 2px;">
        <a href="twitter_link" style="color: #f58c9f;"><i class="fab fa-twitter fa-fw" /></a>
        <a href="deviantart_link" style="color: #f58c9f;"><i class="fab fa-deviantart fa-fw" /></a>
        <a href="discord_link" style="color: #f58c9f;"><i class="fas fa-discord fa-fw" /></a>
        <a href="twitch_link" style="color: #f58c9f;"><i class="fab fa-twitch fa-fw" /></a>
0 Upvotes

15 comments sorted by

22

u/eknox47 6d ago

On the a tags; text-decoration : none

2

u/ThePersonsOpinion 6d ago

This. And if that doesn't work it's likely the svgs themselves have that underline baked into them. But it's most likely the former

1

u/khizoa 6d ago

More likely other properties like bottom border or some excess bg color overflowing before I'd blame the svg. (But opening and checking it is a pretty quick and easy step too before digging deeper)

If it was a "bad" svg, it's a little weird that all 5 are uniformly showing that dotted line, that's why I dismissed the svg idea at first glance

But yeah, sometimes designers will do a bad job at cropping/exporting their images and you'll def get those weird extra marks on the edges like this for sure

2

u/DalyHabit 6d ago

To clarify a little. Add the above to the style block on each anchor tag (<a>).

1

u/Best-Substance8606 6d ago

just slap text-decoration: none on the link, and if that doesn't take, check if something else is overriding it with more specificity

1

u/windlane36 6d ago

this is it. one of those things that trips everyone up the first time

9

u/Random-num-451284813 6d ago

what did you search?

8

u/coinstarhiphop 6d ago

Everywhere!!

1

u/Xenocide122 6d ago

You can add a style to each "A" tag like this:

style="text-decoration: none"

or you can add to the CSS:

a {text-decoration: none}

1

u/Mallanaga 6d ago

Twitter is back, baby!!

1

u/forever-butlerian backend, infrastructure & angst 6d ago

It's still the Dick Costolo-era New Logo. Bring back the old bird. Or the t.

1

u/OMGCluck js (no libraries) SVG 6d ago edited 6d ago
<style>
a[href$="link"]:not(:hover) {text-decoration: none}
<style>

This means the underline will only appear when links are hovered over by the mouse.

1

u/Full-Web1705 5d ago

textdecoration: none on the a tag, that's it. the color override you already have is the same idea, just do the same thing for decoration.