How to Remove Blue Underline from Links using CSS
Links on the web are fundamental to being able to navigate through pages.
Unfortunately, the default styles for links are usually one that you will want to override.
This is because by default, links are both blue and underlined.
In this post, we'll learn how we can use CSS to override the styles of links.
How to override the styles of links
As mentioned before, the two most common thinks you'll want to override is the color of the link and remove the underline.
Let's start with an example link:
This has the default styles of a link, blue and with an underline.
Now, to replace the blue, simply target the link's
a tag and change the color to whatever you want, in this case, black:
Let's check it out using the editor:
Now, we just need to remove the underline.
This is accomplished by adding the
text-decoration: none rule to the link's
Now when we take a look, we'll see that the link is no longer blue and has no underline, yet still functions like a normal link:
In this post, we learned how to override the default styles of a link in CSS and getting rid of the underline and blue.
Simply target the
a tag and change the color to a new color and remove the
Thanks for reading!
- Getting Started with Solid
- Create an RSS Reader in Node
- How to Set Up Cron Jobs in Linux
- Best Visual Studio Code Extensions for 2022
- How to deploy a MySQL Server using Docker
- How to Scrape the Web using Node.js and Puppeteer
- Getting Started with Moment.js
- Building a Real-Time Note-Taking App with Vue and Firebase
- Getting Started with React
- Setting Up Stylus CSS Preprocessor
- Setting Up a Local Web Server using Node.js