Unable to choose the specific div element within the container that has an inset shadow applied by utilizing Pseudo

It seems that I am encountering an issue when trying to select the div elements within a container that has a defined shadow using pseudo elements ::before OR ::after. Once the shadow is applied, the div elements become unselectable.

Please refer to the codepen example at "http://codepen.io/smkudale/pen/lvFCt" for better understanding of the issue.

I have attempted to use Z-index=-1 as a potential solution, but unfortunately, it did not work either.

If anyone has any suggestions or solutions to this problem, your input would be greatly appreciated.

Below you can find the HTML and CSS code used:

<body>
<div class="content">
<a class="shadow">
<div class= "b1"></a>
</div>
<a href="www.google.com">
<div class= "b2">
</div></a>
<div class= "b3">
</div>
<div class= "b4">
</div>
<div class= "b5">
</div>
<div class= "b6">
</div>
<div class= "b7">
</div>
<div class= "b8">
</div>
<div class= "b9">
</div>
<div class= "b10">
</div>
<div class= "b11">
</div>
<div class= "b12">
</div>
</a>
 </div>
</body>

CSS:

  .content
  {
  width:500px;
  height:500px;
  border-radius:500px;
  border:1px solid red;
  background:#ddd;
  margin:0 auto;
  position:relative;
  overflow:hidden;

  }

   .shadow
  {
  display:block;
  position:relative;


   }


   .shadow::before
  {
  display:block;
  content:'';
  position:absolute;
  width:500px;
  height:500px;
  border-radius:500px;
  -moz-box-shadow:inset 0px 0px 9px 9px rgba(0,0,0,0.3);
  -webkit-box-shadow:inset 0px 0px 9px 9px rgba(0,0,0,0.3);  
  box-shadow:inset 0px 0px 9px 9px rgba(0,0,0,0.3);
  overflow:hidden;
  z-index:0

   }


  .b1
  {
  width:125px;
  height:125px;
  background:green;
  margin:5px 5px 5px 5px;
   display:inline-block; 
   float:left;
  }

Answer №1

It appears that the closing tags are not in their correct order.

<a class="shadow">
<div class= "b1"></a>
</div>

The correct structure should be:

<a class="shadow">
<div class= "b1">
</div></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

Send form data using ajax technology

When testing my code on localhost, everything runs smoothly. However, when I tried running it on the server, it doesn't seem to be functioning properly. $("#MyUploadForm").ajaxSubmit(options); I would greatly appreciate any assistance with t ...

Determine a comparative measurement using specific numerical values

I am currently in the process of creating a webpage and I want to ensure that it is responsive by adjusting certain values based on the width of the viewport. Specifically, I have a DIV element that I want to split into 2 columns. For smaller screens (min ...

Problem with displaying fonts in web browsers

I decided to create a React App using the Material UI library, but I wanted to customize it by changing the default font from Roboto to Overpass. I successfully imported the fonts using their library. <link rel="preconnect" href="https:// ...

d3: It appears that my routes are replicating themselves, and I am unable to ascertain the cause

I've been diving deep into D3, studying the works of Mike Bostock and other experts in the field. I'm also going through Scott Murray's book on Interactive Data Visualization specifically focusing on D3. At the moment, my project involves c ...

URL to section of website without the navigation bar portion

I am trying to solve a problem with creating a link that will take me to a specific part of the page while taking into account the height of the navbar. The issue is that since the navbar is fixed to the top with a solid color, it ends up covering part of ...

Modifying the dimensions of mat-card in Angular Material

https://i.stack.imgur.com/CP16N.png I am struggling to make both components the same height, similar to the left form. I have tried adjusting margins and padding but nothing seems to work. Below is the HTML code for the parent element: <mat-tab label= ...

JavaScript updates the cursor after the completion of the JS function

Here is some code that I have been working with: <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> </head> <body style="background-color:yellow;width ...

Manipulating text alignment and positioning in CSS

Can someone help me achieve this CSS result? img1 This is what I have so far: img2 I'm struggling to center the elements and add a line in CSS. Any advice? I thought about using margin: auto, but I'm not sure if that's the best approach ...

Assistance needed with jQuery toggle functionality and managing cookies

I'm currently developing a toggle view script that switches between two views: grid and list. Everything is functioning well, but I'm attempting to implement a cookie to remember the user's selection across page refreshes using a jQuery cook ...

Using ReactJS to search for and replace strings within an array

A feature of my tool enables users to input a string into a textfield and then checks if any words in the input match with a predetermined array. If the user's string contains a specific name from the array, I aim to replace it with a hyperlink. I&a ...

Steps for styling an AngularJS Popup:1. Determine the desired appearance for

I have some code that displays a popup when clicked, along with its automatically generated CSS. I want to be able to make changes to the CSS by adding IDs or classes to it. How can I assign IDs or classes to this element so that I can easily target them f ...

Is there a way to trigger a function within the submit handler with jQuery validation?

I've been attempting to trigger an ajax function once the form is validated, but I'm running into some issues. The jQuery on-submit method below is working perfectly for me. $('#promotionAdd').on('submit',(function(e) { ...

What is the proper way to include 'rowspan' specific CSS within an HTML table?

I have an HTML table with rowspans in it: table tr, td { border: 1px solid black; } tr:nth-child(1) { background-color: red; } tr:nth-child(2) { background-color: blue; } <table> <tr> <td rowspan=2>Section 1</td> ...

Populating hidden fields in Javascript with mouseover event trigger - Pre-click action

Seeking a solution for another issue, I stumbled upon the capability to execute JavaScript on mouseover. Here is what I want to execute: $(document).ready(function(){ function myPayment() { var value = document.mortgagecalc.value_input.value; var rate ...

Unable to achieve full width for a div within a scrollable container

Currently, I am in the process of constructing a new website using Gatsby.js. However, I have encountered a minor issue with some CSS related to code blocks. Since CSS is not my strong suit, I have been unable to resolve it thus far. Below is a runnable sn ...

Exploring search capabilities within D3 graph nodes

After creating a JSON file with four tiers and utilizing D3.js's collapsing box format to visualize it (source: https://bl.ocks.org/swayvil/b86f8d4941bdfcbfff8f69619cd2f460), I've run into an issue. The problem stems from the sheer size of the J ...

Clear the modal form in Codeigniter and AJAX upon closing the edit modal

Having an issue with my modal form - when I open the edit modal, the data is fetched and that part works well. However, when I close the modal and try to add a new user, the data is automatically fetched again. Why is this happening? Shouldn't the for ...

instructions on how to showcase a text message within the fontawesome square icon

Can someone help me with styling my code? I want to display a text message inside a square box with dimensions of 1x. <span class="fa-stack fa-5x" style="margin-left:5%"> <i class="fa fa-square-o fa-stack-2x"></i> </span> ...

Is using canvas the best option for creating simple image animations with JavaScript?

I am currently working on a basic animation project using JavaScript. This animation involves switching between 13 different images per second to create movement. I have created two simple methods for implementing this animation. The first method involves ...

Aligning the navigation links vertically

I am working on aligning my navigation bar vertically, even when I scroll the page. I found a method in another thread which suggests using the following CSS code for vertical alignment: #container { position: absolute; top: 50%; height: 400p ...