The "pointer-events: none" command is not functioning as expected in Chrome browser

Here's an interesting situation. I have an arrow that users click on to navigate to the next page in a photo gallery. The arrow image is wrapped in an anchor tag with the href attribute pointing to the next page, hardcoded into the HTML.

<a href="thepagetogoto08.html"><img src="images/next.gif" alt="Right arrow" class="hide"></a>

When it reaches the final page and I don't want the arrow to be visible or clickable, I simply add the class "hide".

In my CSS file, I define the hide class like this:

.hide {
  visibility: hidden;
  pointer-events: none;
  cursor: default;
}

Interestingly, this setup works fine in Safari (desktop version, not yet tested on IOS) but does not work in Chrome, Firefox, or Opera. The arrow is hidden, but the cursor still changes to a hand pointer and the link remains active.

Could the issue with pointer-events functionality require a webkit prefix, or should I consider exploring alternative methods to achieve the desired behavior?

Answer №1

To ensure proper functionality, the hide class should be applied to the anchor tag instead of the image tag as it serves as the interactive element.

<a href="redirectpagelink13.html" class="hide"><img src="images/forward.gif" alt="Arrow pointing right"></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

Does width change based on position?

When I set position:absolute for an element, its width remains constant regardless of the text inside. However, if I set position:relative for the same element, the width will adjust based on the text content. I have created a fiddle with two menus, each ...

forming a boundary that stands alone, unattached to any other boundaries

I am trying to design a navigation bar that resembles the one depicted in the image provided. The concept involves creating a navigation bar where each border is separated from the others, potentially achieved using hr tags. However, I am struggling to fi ...

When the div element reaches the top of the page, it sticks to the top and is only displayed when the user

In the center of a full-screen hero section, there is a form. When it reaches the top, its position becomes fixed and additional classes are added through a script - such as shrinking its height and adding a background. What I aim to achieve is for the fo ...

Creating an a-expanded attribute with the value set to "true" for styling purposes

Is it possible to utilize the expanded attribute for styling using CSS? I have a dropdown with the following attribute: expanded="false" When the dropdown is open, the attribute changes to: expanded="true". Since there is no specific class assigned, I ...

Remove the "Show Quoted Text" feature from your Gmail experience

How can I code HTML emails to avoid displaying "show quoted text" and preventing text from turning purple? The system I am developing sends a notification to users when they receive a reply, but after two or more replies from the same person, everything ex ...

Is it possible to incorporate dots into a CSS-only slider design?

Is it possible to incorporate dots into my pure CSS slider? As a novice in CSS, I'm struggling to figure out how to do this. My attempts so far have resulted in the dot not aligning correctly with my images. I am exclusively using CSS for my slider. C ...

Issues with screen scrolling becoming stuck in React and Material UI

Currently facing an unusual issue where scrolling on my mobile website becomes sticky, with intermittent responsiveness to touch. Struggling to identify the root cause as there are no console errors detected. Provided below is a snippet of code for a subse ...

Is there a way to transform this fixed alignment of divs, etc. into a responsive layout that automatically adjusts to different screen sizes? - Using HTML and CSS3

If you want to see the demo, you can check it out on JSFiddle by clicking on this link: JSFiddle Demo. This webpage utilizes Twitter's Bootstrap framework, which you can find more information about by visiting . When inspecting the stylesheet on JSF ...

Modify a CSS style with JavaScript or jQuery

Can CSS rules be overwritten using jQuery or JavaScript? Imagine a table with rows categorized by different classes - "names" for persons and "company" for companies. How can we efficiently hide or show specific rows based on these classes? If we have a ...

Ways to troubleshoot the issue of a non-working "Onclick function"

let username; document.getElementById("mySubmit").onclick= function(){ username= document.getElementById("myText").value; document.getElementById("myH1").textContent= `Hello ${username}` } <!DOCTYPE html> <html lang="en"> <head> < ...

CSS Grid: Dividing items equally based on the number of items present

Currently, I am delving into grid layouts in CSS and experimenting with code to divide a row. Here is the snippet I am playing around with: .grid-sample { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; row-gap: 4rem; padding: 0 5rem ...

Using JavaScript (without jQuery), take away the CSS class from an element

Seeking assistance from experts on the process of removing a class from an element solely using JavaScript. Kindly refrain from suggesting solutions involving jQuery as I am unable to utilize it, and have little knowledge about its functionalities. ...

Could there be any elements in the code that serve no purpose?

Here is an image of the design I envision. It will feature a sticky footer that remains at the bottom of the page at all times. The main content area should adjust its height to fill the space between the header and footer, with a scrollbar appearing ...

When adding text to a React Material UI Box, it can sometimes extend beyond the boundaries

I'm currently working on a straightforward React page, but I've encountered an issue right from the start: my text is overflowing the box and I can't figure out why. Could someone take a look at my styles? Here's a picture showing the ...

What's the reason for not being able to customize classes for a disabled element in Material-UI?

Currently, I am utilizing Material-UI to style my components. However, I am facing challenges when trying to customize the label class for disabled buttons. Despite setting a reference as "&$disabled", it does not yield the desired results. import Rea ...

Tips for utilizing z-index effectively in conjunction with a sticky header

I'm having trouble getting my footer to display correctly on top of a sticky header. Even though they are both in the same level markup, it just doesn't seem to work as expected. Interestingly, a snippet of code below appears to be working, but ...

Is it possible to stop the manipulation of HTML and CSS elements on a webpage using tools similar to Firebug?

How can we prevent unauthorized editing of HTML and CSS content on a webpage using tools like Firebug? I have noticed that some users are altering values in hidden fields and manipulating content within div or span tags to their advantage. They seem to be ...

Tips for utilizing the nth-child selector to exclude hidden divs

I am facing an issue with displaying random blocks in rows. Each time a block falls into a new row, I want it to have a different style. However, when the user clicks on a button to hide certain blocks using display:none, the problem arises because the nth ...

The Chrome Extension for Automation has experienced a critical error and stopped

Currently automating Google Chrome using Selenium in C#, with the latest Chrome (78.0.3904.70), Selenium.Webdriver (3.141.0), and Selenium.Chrome.Webdriver (77.0.0). Initializing ChromeDriver using ChromeDriver chrome = new ChromeDriver();. However, encou ...

Having trouble with compiling SCSS code

While diving into the world of SCSS, I decided to compile my SCSS into CSS using npm. So I entered npm run compile: sass as defined in my package.json as follows: "scripts": { "compile:sass": "node-sass sass/main.scss css/style ...