The CSS perspective shape link is not functioning correctly

I'm attempting to create a trapezoid shape using CSS to contain a link, but it doesn't seem to be functioning correctly. I'm unsure if it's due to lack of support or if there's an issue with the code itself. It looks like it should be working! Does anyone have any insight on what might be causing this issue?

Just to clarify, the trapezoid shape itself works, but the link inside the shape is unresponsive.

Below is the code snippet I'm using:

.box {
  width: 180px;
  height: 70px;
  position: relative;
  padding: 0px;
  left: 10%;
  text-transform: uppercase;
  text-align: center;
  padding-top: 34px;
  padding-bottom: 10px;
}
.box:before {
  content: "";
  position: absolute;
  border-radius: 1px;
  box-shadow: 0 1px 0 3px #27628e;
  top: -5%;
  bottom: -11%;
  left: -1%;
  right: -5%;
  z-index: ;
  -webkit-transform: perspective(50em) rotateX(-50deg);
  transform: perspective(50em) rotateX(-50deg);
}
<div class="box"><a href="http://google.com">google.com</a>
</div>

Answer №1

.box a{
position:relative;
}

Clicking on the URL will activate the function.

.box {
  width: 180px;
  height: 70px;
  position: relative;
  padding: 0px;
  left: 10%;
  text-transform: uppercase;
  text-align: center;
  padding-top: 34px;
  padding-bottom: 10px;
}
.box:before {
  content: "";
  position: absolute;
  border-radius: 1px;
  box-shadow: 0 1px 0 3px #27628e;
  top: -5%;
  bottom: -11%;
  left: -1%;
  right: -5%;
  z-index: ;
  -webkit-transform: perspective(50em) rotateX(-50deg);
  transform: perspective(50em) rotateX(-50deg);
}
.box a{
z-index:999;
  position:relative;
}
<div class="box"><a href="http://google.com">google.com</a>
</div>

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

HTML5 video player with secondary playlist

Looking for a videoplayer setup where there are two playlists, but only one can play at a time. When choosing a video from the first list initially, nothing happens. However, after selecting a video from the second list, the first list starts working. HTM ...

Iterate over JSON dates in JavaScript

Trying to utilize JavaScript in looping through a JSON file containing time periods (start date/time and end date/time) to determine if the current date/time falls within any of these periods. The provided code doesn't seem to be working as expected. ...

"Enhance Your Dining Experience with a Menu that Captiv

My goal is to create a small menu with only the initial letter of each name visible, but when focused, I want the full word to appear. Here's an example: css: .menu:focus { } php: <nav> <li class="menu"><a ...

In Javascript, when trying to call Firebase database child(), it may sometimes result in the return value being "

Here is the current setup: Firebase Database: setores: { -KkBgUmX6BEeVyrudlfK: { id: '-KkBgUmX6BEeVyrudlfK', nome: 'test' } -KkDYxfwka8YM6uFOWpH: { id: '-KkDYxfwka8YM6uFOWpH', nome ...

Enhance Your Website with HTML5 Video Transition Effects

Is it possible to recreate video transition effects using HTML5 similar to the ones shown in this example: Can this be achieved across all major browsers, including Safari, Firefox, Chrome, and IE9? ...

Organizing AngularJS Data by Initial Letter with the <select></select> HTML Element

I'm trying to figure out how to filter an ng-repeat function based on the first letter of each option. For example, I want to filter a set of array or string so that only options starting with "A" or "B" are displayed. Can anyone help me with this? H ...

Transform the JavaScript object received from an AJAX request into HTML code

Here is an example of what the result (data) looks like: <tr> <td> Something... </td> </tr> <div id="paging">1, 2, 3... </div> This is using ajax to retrieve data. ... dataType: "html", success: function( ...

Using flex and align properties to position two elements on the right and one on the left is a common layout challenge

I'm facing an issue with element positioning and text alignment. The navigation container consists of three elements: logo, title, and nav-list. You can find the code on CodePen. /**{ margin: 0; padding: 0; box-sizing: ...

What is the best way to display ng-repeat elements in a horizontal layout

Looking for a way to display thumbnails horizontally using ng-repeat in AngularJS and Bootstrap. Any ideas on how to achieve this with CSS or Bootstrap? <div class="row"> <ul class="col-md-4" id="phones"> <li class="thumbnail" ...

Utilizing grease/tampermonkey (or any other browser extension) to filter out specific characters within webpage elements

Forgive me if my language is not accurate, as I am still learning about programming. The forum that I visit has cluttered the page with unnecessary and glitchy images and text for a promotion. This has made the forum difficult to navigate. I was successful ...

The merging of several XSL files

Hey there, I have two separate xsl files and an xml file. Is there a way to merge these xsl files into one transform type to create a single HTML output? The first xsl file is called index.html: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCT ...

Issue with page not updating after local storage change and returning to previous page

I have encountered an issue where in Firefox and Safari, the value retrieved from localstorage on the first page is not updated until I manually refresh the page after setting the localstorage value on the second page. Disabling the cache did not resolve t ...

An uncomplicated vessel design

Having experience in mobile programming, I am accustomed to creating a parent hidden view and positioning subviews inside it. Now, I am trying to replicate the same functionality using HTML/CSS/Bootstrap. Let's say I have already laid out a cover bac ...

Bring in an HTML page into a DIV element by utilizing .load with jQuery

I have a PHP function that generates and returns HTML content, and I want to display that content in a DIV when the page loads. Currently, I am attempting to do this by: <div id="myModal" class="reveal-modal" title="El Farol" data-animation="fade"> ...

Navigating a Bootstrap modal using arrow keys for scrolling - up and down

I attempted to address this issue by using the following code: // here, 'this' represents the modal $(this).focus(); Despite trying the above solution and even attempting to trigger a click event on it, I was unable to get it to work! UPDATE ...

The ScrollToTop feature in MUI component seems to be malfunctioning when paired with the useScrollTrigger hook

I am in the process of developing a custom ScrollToTop component using MUI's useScrollTrigger hook. More information can be found at this link Feel free to check out the sample code here: https://codesandbox.io/s/stackoverlow-mui-usescrolltrigger-er9 ...

When the user hits the enter key, automatically submit a form without the need for

Is it possible to submit a form on enter using type="button"? Here are my input fields: <input type="text" id = "login-user" class="form-control log-input" placeholder="Username" required="required"> <input type="password" id="login-password" clas ...

Creating a responsive grid division

.subcategory-main-wrapper { display: grid; grid-template-columns: repeat(4, max-content); position: absolute; width: 100%; column-gap: 4%; justify-content: center; height: 360px; @media @tabletScreens { height: 280px; } @media @ ...

Dynamic content alongside a stationary sidebar that adjusts in width

Attempting to create a switchable sidebar (toggling between short and long form) using bootstrap, multiple examples, and online resources. The width of the sidebar changes when toggled, and I want the content to appear next to it regardless of its length. ...

Begin by opening a single div for each instance

I want a functionality where opening one div closes all the others. I've searched around for solutions and only found jQuery options, not pure JavaScript ones. Here is my code: function openDescription(description_id) { var x = document.getEle ...