Text adornments persisting even after formatting removal (underline disappears, but text remains embellished)

I included a link within a div and applied text-decoration: none; to the anchor tag as shown below:

Here is the CSS (SCSS) code snippet used:

&__link {
    &:link,
    &:visited {
      text-decoration: none;
    }
  }

And here is the corresponding HTML code:

<div class="feature-box">
                    <a href="#" class="feature-box__link js--scroll-to-services">
                      <svg class="feature-box__icon feature-box__icon--1">
                        <use xlink:href="img/sprite.svg#sewage"/>
                      </svg>
                        <h3 class="heading-tertiary u-margin-bottom-small">Vee ja kanalisatsiooni-<br>süsteemide ehitus</h3>
                        <p class="feature-box__text">
                          Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam, ipsum sapiente aspernatur.
                        </p>
                    </a>
                  </div>

The issue I encountered is that setting text-decoration: none property only removes the underline from the text, but the color of the text remains purple as if it has already been visited.

Answer №1

The color of the text is determined by the color property, not by the text-decoration property. Make sure to set the color property to your desired color.

Answer №2

In order to change the text color to black, make sure to apply the color: black; property. Remember, the text color serves a functional purpose rather than just being decorative.

Answer №3

Apply the same color to both link and visited, as illustrated in the code snippet below, this styling is independent of text-decoration: none.

.link,
.link:link,
.link:visited {
  color: blue;
}

Answer №4

Choose the color for the &.feature-box__link as desired

&.feature-box__link {
    &:link,
    &:visited {
      text-decoration: none;
      color:black;
    }
  }

To see the code in action, click here:https://jsfiddle.net/gj1cL8en/4/

Answer №5

The programmer's response + the unique color generated by certain default browser settings. It is imperative to establish specific guidelines to supersede these defaults.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The HTML source code in the browser varies from the output obtained through Python requests

I've noticed a discrepancy between the HTML source code displayed in my browser and the code I receive when using Python's requests.get function. You can see the image depicting this issue at the following link: Any thoughts on why this might be ...

Setting a page title using PHP based on a conditional statement can be achieved by

I am attempting to display a different title for each page In the header.php file, I am checking the file name to set the correct title like this <?php $page = basename($_SERVER['PHP_SELF']); if ($page == 'index.php'): ?> <ti ...

Adjust multiple components at once

I'm working on creating a "textarea" with a toolbar that displays rich text content based on the HTML content stored in the background textarea. Here is an example of the HTML structure: <div class="primary-content"> <div class=" ...

Are there any methods to link CSS with UI specific classes?

Is there a way to connect CSS styles and UI custom classes? For example, can I create a class that inherits from the UIButton class and add CSS styles to it? EDIT My custom CSS: .button { border: 3px solid #0a3c59; background: #3e779d; /* more C ...

Error code "ER_BAD_FIELD_ERROR" was encountered with errno 1054 and sqlState "42S22" in index 0 while using MySQL with Angular and managing sessions

When I log in, the following code is executed: <div ng-include="'partials/navbar'"></div> <form name="form" ng-submit="login(form)"> <div> <input type="text" placeholder="Email" ...

Sending various values via a click in an HTML link

Hello, I am attempting to pass multiple values using the HTML onclick function. I am utilizing Javascript to generate a table dynamically. var user = element.UserName; var valuationId = element.ValuationId; $('#ValuationAssignedTable').append(&a ...

Grammarly is seamlessly inserting padding into my body element

After setting up my website on GitHub, I ran into an issue where the Grammarly Chrome extension was automatically adding a padding-top attribute to the body tag. <body data-new-gr-c-s-check-loaded="14.1028.0" data-gr-ext-installed="" ...

Tips for retrieving selected items in an array object

Within my UI, I have a select field that, on change, populates corresponding data in a div with nested ul and li elements. What I am attempting to achieve is to convert the selected items within the list (which include checkboxes) into an object of arrays ...

Implementing dynamic class changes with *ngIf within a child component

Apologies if this question has been addressed before, I found two similar answers here: Question related | Close Solution An Angular Material Sidenav component contains three components. The parent component (highlighted in red) includes tab-like but ...

What is the best way to align this alert in the center of the screen

Hey there, I'm facing an issue with aligning an alert horizontally when a user clicks a button. I've been trying different methods but can't seem to get it right. The goal is to keep the alert within #main. You can check out this fiddle for ...

Using Javascript, display an image that was previously hidden with CSS when a radio button is selected

Within a table of 25 rows, each row contains an attribute accompanied by an image (represented by a tick symbol) and five radio buttons for rating the attribute from 1 to 5. Upon clicking one of the radio buttons, the hidden image (tick symbol) should beco ...

Issue with connecting the 'Enter' key to the button - no success

My current setup involves using jQuery to link the Enter key to an HTML button through this code snippet: $("#console").keyup(function(event){ if(event.keyCode == 13) { $("#submit").click(); } }); HTML: <input autocomplete="off" type= ...

Javascript alert function for confirming background color

Options are displayed in blue, and using JavaScript, I check if the background color is blue. If it's not, execute the next step; otherwise, display an alert message. function click_option_A() { var clr_1_chk = document.getElementById("1"); //alert ...

Choosing one element from various options in multiple forms

I'm encountering an issue with selecting a specific element from multiple forms in my JavaScript code: The current JavaScript function I am working with is as follows: function makeActive(target) { $("div.interactive").removeClass("interactive") ...

What methods can be used to restrict the user from typing at the very end of a scrollable textarea?

Hello there, I hope everything is going well for you! I'm currently working on a project with a basic code editor and trying to find the best way to add some space at the bottom of the textarea. I don't want users to always be typing right at th ...

What is the best way to ensure that two col-lg-6 elements stay horizontally aligned on mobile screens?

What is the best way to keep two col-lg-6 columns aligned horizontally on mobile devices using Bootstrap? ...

Transform static borders into mesmerizing animations by changing the solid lines to dotted lines using CSS

I've managed to create a circle animation that is working well, but now I'm looking to switch from solid lines to dotted lines. Can anyone provide guidance on how to accomplish this? Here is the current appearance: #loading { width: 50px; ...

The functionality of Jquery and JS lies in working on DOM elements as opposed to

Just to start off, I want to mention that my knowledge of JavaScript and specifically jQuery is quite limited. I've encountered an issue with some JavaScript and jQuery loading on my webpage. 1) I have written some code on JSFiddle http://jsfiddle.n ...

Having Trouble Operating Virtual Tour in Flash

I recently used a third-party software to create a virtual tour for my client's website. The virtual tour works perfectly fine on its own, as you can see here: However, when I tried to include the virtual_tour.html page on the index page of the websi ...

Tips for utilizing Jquery webcam on mobile devices like Android and iPhone

Currently, I am in the process of developing mobile web applications utilizing jquery mobile and HTML 5. I am working on a feature that requires access to the camera. In order to achieve this functionality, I have integrated the following plugin: While ...