Troubleshooting CSS Hover Not Displaying Properly in Angular 14

In the footer class of my HTML, there is a code snippet with chevrons:

<div class="link-list">
    <div *ngFor="let link of insideLinksLeft | originalOrderKeyValue" class="link">
        <a [href]="link.value" class="animated-link">{{link.key}} <i class="arrows-right fas fa-chevron-right fa-xs"></i></a>
    </div>
</div>

I want the arrows-right to move right on hover over the animated link. Here's what I've tried:

.arrows-right {
    margin-top: 13px;
    margin-left: 10px;
}

.arrow-right:hover {
    right: 20px;
}

The CSS for arrows-right works but not when inside an <a> tag. If you have a better solution, please let me know.

I also attempted this approach without success:

a.animated-link {
        color: #D1E2FF;

        &:hover {
            color: white;
        }
        &:hover .arrow-right {
            transform: translate(-50%, 0);
        }
      }

Below is the complete CSS page layout for reference:

@import "/src/assets/style/variables";

@background-black: #4A4A4A;

.footer-wrap {
  width: 100%;

  .links-footer-wrap {
    padding: 50px 0;
    background: @background-black;

    .col {
      padding: 0 45px;
      border-left: 1px solid @border-gray;

      &:first-child {
        border: none;
        padding-left: 0;
      }

      .col-title {
        color: white;
        font-size: 28px;
        margin-bottom: 10px;
      }

      .link-list-wrap {
        display: flex;
        justify-content: space-between;
      }

      .link {
        min-width: 205px;
        margin-bottom: 10px;
      }

      a.animated-link {
        color: #D1E2FF;

        &:hover {
            color: white;
        }
        &:hover .arrow-right {
            transform: translate(-50%, 0);
        }
      }

      img {
        width: 100%;
        margin-bottom: 10px;
      }
    }
  }

  .arrows-right {
    margin-top: 13px;
    margin-left: 10px;
  }

  .arrow-right:hover {
    right: 20px;
  }

  .privacy-footer-wrap {
    font-size: 13px;
    padding: 15px 0;
    background: #F7F4EE;

    .privacy-footer {
      display: flex;
      justify-content: space-between;

      .policy-link-wrap {
        width: 210px;

        .privacy-link {
          color: @link-blue;
          font-weight: bold;

          &:hover {
              color: @hover-blue;
          }
         }
      }
    }
}
}

Answer №1

When the .arrows-right class is nested inside the animated-link class, you can easily apply the following CSS:

.animated-link:hover .arrows-right {
    margin: 15px;
}
<a class="animated-link> Link <i class="arrows-right"> Arrow </i></a>

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

Having trouble with my Angular subscription - not behaving as I anticipated

I am facing an issue on my shop page where I have a FilterBarComponent as a child component. On initialization, I want it to emit all the categories so that all products are rendered by default. However, on my HomePageComponent, there is a button that allo ...

Updating route from action within Vuex Store

Exploring ways to trigger a route change from the store. I attempted to import router directly into the store and use the following code: LOG_OUT({commit}){ commit('LOG_OUT__MUTATION'); router.push({ name: 'Login' }) } Unfo ...

Sketch a variety of numerical values in a circular formation

I was working on a number circle using the below fiddle, but I need it to always start from 0 at the top. How can I achieve this? Additionally, I would like to connect the numbers from the inner circle border to the number with a dotted line. How can I dr ...

Ensure that the extension is only loaded once Angular has fully loaded

I am currently working on a Chrome extension that incorporates event listeners to elements within a page utilizing Angular 1.2.10. The following code snippet is an example of what I have: window.addEventListener("load", (event) => { var switchButton = ...

Is there a way to adjust the placement of the h1 tag using the before pseudo-element?

I'm looking to place an image on the left side of each h1 tag. I've been attempting to utilize the before pseudo element for this task. The issue arises when there is no content, causing the before pseudo element to overlap with the h1 tag. How ...

In JavaScript with Node.js, how can one verify a file's size and only download the initial kilobyte of the file?

When using Javascript/Node JS to download a file, you can check the file size and download only the first kilobyte of the file. This is useful if you want to hash the first kb and compare it with the hash of the complete file. If the hashes match and the ...

Troubleshooting Angularjs: Why isn't the HTML displaying the variable value?

Trying to display the value of an AngularJS variable in HTML using this code: <div ng-controller="MyTextbox"> <p>Last update date: {{nodeID1}} </p> Here's my angularjs controller code: angular.module("umbraco").controller("MyTex ...

Exploring the realms of Django Administrator with external JavaScript integration

Currently, I am working with django 2.0 that includes jquery 2.2.3. My goal is to implement the ImageViewer Javascript app (https://github.com/s-yadav/ImageViewer) on one of my admin pages. I have added the necessary js and css files to the Media class wit ...

Tips for displaying images dynamically in HTML using AngularJS

src={{logo}} var logo = 'localhost:3000/modules/images/default.png' I'm trying to display the image path dynamically, but it's not showing up in the HTML. Do I need to use quotes for src? Can someone please assist me with this issue? ...

Creating a list of identical elements with shared attribute values using nightwatch.js or JavaScript - a step-by-step guide

I have been using nightwatch.js for automating tests on a web application, and I am facing difficulties in creating a list of elements that share common values in their attributes. Below is an example: The first three spans with a common value for the att ...

What are the steps to designing customizable drop-down content menus on websites?

I am looking to implement a feature where I can create content drop-down bars similar to the ones shown in the images. When a user clicks on the bar, the content should be displayed, and if clicked again, the drop-down should hide. I have searched for a so ...

Issue encountered with websocket connection while attempting to include dependencies

My current project involves integrating charts for the graphical component using React within an Electron software. I've added interaction with buttons (sections) to insert different data into the graphs based on user clicks on one of the sections. Th ...

Switching on Closed Captions for HTML5 video while deactivating the standard video controls

I am facing two issues. Whenever I include the track tag in my video element, the default controller of the video pops up, which is causing conflicts with my custom controls. Secondly, I am unable to figure out how to turn closed captions on and off. Thi ...

Using setInterval with Internet Explorer 10

In Internet Explorer 10, the setInterval function does not work properly. I have a web page where, upon form submission, a lengthy process is triggered on the server to download a file. To keep users updated on the progress, I utilize setInterval to repeat ...

What could be causing this jQuery color picker to malfunction when used inside a Bootstrap modal?

Currently, I am utilizing the fantastic jQuery color picker provided by Although it functions as expected in "normal" scenarios, I have encountered an issue where the picker fails to display when the input parent element is nested within a Bootstrap 3 mod ...

Explore the power of accessing XML data using JavaScript

Currently, I am dealing with an XML file and attempting to extract data from it. The structure of the XML file is as follows: <doc> <str name="name">Rocky</str> <str name="Last_name">balboa</str> <str name="age ...

Acknowledging client after client to server POST request has been successfully processed in Node.JS

I've been working on responding to client-side requests with Node.JS. While searching, I came across a helpful article on calling functions on the server from client-side JavaScript in Node JS. However, I'm having trouble implementing it in my pr ...

Leverage the selected values to dynamically generate a table using jQuery

Can someone help me figure out how to store multiple values from a selection and then create an array using jQuery? Here's the scenario: In my multiple selection, I have 5 values: <select name="animal" id="animal" multiple="multiple">    ...

CSS Troubleshoot: Unable to Change Background of Current Menu Page Item

I've been attempting to add a small graphic using CSS to indicate the current page the viewer is on, but for some reason, it's not highlighting properly. Below is my code: HTML: <ul class="side-nav"> <a href="http://www.cieloazulsant ...

What is the best way to pass and save information across different routes in Express using Node.js?

Let's delve into the specific functionalities I envision for my server. Essentially, my project involves user registration and login processes. The URLs for these routes are as follows - localhost:3000/login and localhost:3000/register Upon successf ...