Hover shows no response

I'm having trouble with my hover effect. I want an element to only be visible when hovered over, but it's not working as expected.

I've considered replacing the i tag with an a, and have also tried using both display: none and display: block in the CSS. However, the issue persists. What could be causing this problem?

This is my HTML:

<div class="vertical-line"></div>
<div>
    <h4>{{ banner.textPrimary }}</h4>
</div>
<div>
    <h2>{{ banner.textSecondary }}<br /></h2>
</div>
<div class="vertical-line"></div>

<div>
    <a href="{{ banner.buttonLink }}" target="_blank">
        <button
            [style.background-color]="banner.buttonColor"
            style="border: solid 1px"
            class="btn-about-us"
            mat-raised-button
            color="primary"
        >
            {{ banner.buttonText }}
        </button>
    </a>
</div>
<i
(click)="openBannerDeleteModal(banner.uuid)"
*ngIf="isAdminFlag === 'true'"
class="fas fa-trash-alt delete-modal"
id="banner-delete"
aria-hidden="true"
></i>

And here is my CSS:

.delete-modal{
   cursor: pointer;
   position: absolute;
   bottom: 80%;
   left: 91%;
   z-index: 1000;
   visibility: hidden;
}

.delete-modal:hover{
   visibility: visible;
}

Answer №1

If you use visibility: hidden;, the hover effect will not work as expected – this is a standard behavior. In this situation, I recommend using opacity instead.

.delete-modal {
  ...
  opacity: 0;
}

.delete-modal:hover {
  ...
  opacity: 1;
}

Answer №2

If an element is not visible on your page, you won't be able to hover over it and trigger the hover event. In this case, consider placing the hover effect on the parent element and then use CSS to make the desired element visible.

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

Display the spinner until the data is successfully updated in the DOM using Angular

Dealing with a large dataset displayed in a table (5000 rows), I am attempting to filter the data using column filters. When applying the filter, I have included a spinner to indicate that the filtering operation is in progress. However, due to the quick ...

``What is the process for retrieving an object array that has been stored in a session using

I have a new class definition: class ProductDetails { name!: string; price!: number; } I keep an array of these objects in the local storage like this: productList: Array<ProductDetails> = []; ... ... localStorage.setItem("CurrentProducts ...

The 'file' property of undefined throws an error in ng-file-upload

I am currently exploring the functionality of ng-file-upload from this repository: https://github.com/danialfarid/ng-file-upload I have successfully implemented the basic setup as follows: HTML: <section ng-controller="MyController"> ...

Unlinked Typescript blob file name

Is there a way to set the file name for a blob in typescript? I have found a solution for IE, but it seems impossible for Chrome. I need something similar to this solution, but in typescript. downloadFile(data: any) { var blob = new Blob([data], {type ...

Steps to revert table data back to its original state after editing in Angular 12 template-driven form

Currently, I have implemented a feature in my web application where users can edit table data by clicking on an edit hyperlink. Once clicked, cancel and submit buttons appear to either discard or save the changes made. The issue I'm facing is related ...

Exploring the differences between utilizing Node JS Express for server-side development and displaying console output to

Recently, I started delving into the world of node js and came across IBM's speech to text sample application (https://github.com/watson-developer-cloud/speech-to-text-nodejs). This app utilizes the express framework and showcases transcribed audio fr ...

Is there a different method like Calc() to create a static sidebar alongside content?

Is there a way to achieve a fixed sidebar on the left and a content area on the right without using calc() in CSS? I'm looking for a more universally supported method that works across different browsers. .left-sidebar { width: 160px; ...

Tracking the progress of an AJAX call with a progress bar or progress status

Using an ajax call, I want to display progress status inside a text box. Below is the code for the ajax call: <input type="text" name="cm" id="cm" /> <script type="text/javascript" language="javascript"> $('#cm').blur(function() ...

Is the issue with AJAX and a global variable a result of my misunderstanding?

My goal is to use AJAX to load client data onto a page and then replace a company ID with the corresponding name from a different company table in the same database. However, I am facing an issue where the global JavaScript variable is not being updated wi ...

Simulate asynchronous function in imported module

Is it possible to monitor the behavior of an asynchronous function in a module that has been imported? jest.mock('snowflake-promise'); import { Snowflake } from 'snowflake-promise'; describe('Snowflake', () => { let sn ...

Validate the error value of the confirmation message box

I wrote a script to create a confirmation popup window. However, when I implement it in our aspx.cs page, it seems to be returning incorrect values. Here is my script: <script type="text/javascript"> function Confirm() { var confirm_value = docu ...

Utilizing the combineReducers() function yields disparate runtime outcomes compared to using a single reducer

Trying to set up a basic store using a root reducer and initial state. The root reducer is as follows: import Entity from "../api/Entity"; import { UPDATE_GROUPING } from "../constants/action-types"; import IAction from "../interfaces/IAction"; import IS ...

Having trouble selecting a box with Selenium Webdriver in Python

When using Selenium Webdriver with Python, I am facing an issue clicking on the box that contains the text "24h". Here is my code snippet: from selenium import webdriver from PIL import Image from selenium.webdriver.chrome.service import Service import ti ...

The code snippet for the carousel in Bootstrap does not function correctly in VSCode, yet it operates effectively on codeply.com

code: <div class = "carousel-inner"> <div class = "carousel-item active" style = "background-color:red" > <h2>I don't have to sniff other dogs anymore for love. Thanks to TinDog, ...

Disappearance of logo div causes video to vanish

Hey there fellow coders! I'm facing a little issue. I'm attempting to replicate my webpage on another page, but every time I try to remove the logo, the video disappears as well. It's quite puzzling. I have the code in place, but it seems l ...

Conflicts in routing between Node.js and AngularJS

Currently, my setup involves NodeJS, gulp, and Angular with ui-router. However, I have encountered an issue when configuring Angular to remove the tag (#) from the routes. The problem arises as Angular's routes do not seem to work properly, and the na ...

Vuejs: Develop an intermediate component that utilizes one of the props and passes on all other content to the <button> element

Just getting started with Vue and struggling to articulate the problem, possibly a duplicate issue. We have a common pattern in our codebase where there is a button accompanied by a message depending on whether the button is disabled. Here's a simpli ...

What causes Firefox's CPU to spike to 100% when a slideshow begins that adjusts the width and left coordinates of certain divs?

Seeking Advice I'm in need of some help with identifying whether the code I'm working on is causing high CPU usage in Firefox or if it's a bug inherent to the browser itself. The situation is getting frustrating, and I've run out of so ...

Display and conceal different sections using hyperlinks

Hey there, I'm back with another issue related to this code snippet on jsfiddle: https://jsfiddle.net/4qq6xnfr/9/. The problem I'm facing is that when I click on one of the 5 links in the first column, a second div appears with 3 links. Upon clic ...

The barcode is not displaying when using javascript:window.print() to print

I am currently developing a Mean Stack App where I have a requirement to display a barcode. To achieve this, I am utilizing an AngularJS directive for generating a 128 barcode, and it is being generated successfully. However, when I attempt to print by cli ...