How can one ensure that the inset box shadow appears above child links while still allowing them to be clickable?

I am facing a challenge with a div that has an inset box shadow. The issue is that there are links within the div and I want the shadow to display over them while still allowing the links to be clickable.

Here's an example: https://jsfiddle.net/5rsbn927/

<div id="navigation" role="navigation">
<div id="navbar" role="navigation"> <!-- this div has shadow -->
    <a href="#" id="link1">Link</a><a href="#" id="link2">Link</a><a href="#" id="link3">Link</a><a href="#" id="link4">Link</a><a href="#" id="link5">Link</a><a href="#" id="link6">Link</a>
</div>
</div>

The #navbar div has the shadow applied and all the links are inline-blocks.

I have tried various methods like z-index (with positioning), pointer-events, :before, but none seem to work as desired. Whenever I manage to get the shadow above the links, they become unclickable.

This is how it should look; I just need to change the background while keeping the same shadow effect when hovering over the link: https://i.sstatic.net/VUA18.png (I also changed the color in the jsfiddle for better visibility).

At this point, I am open to using jQuery or any other method besides box-shadow; the primary goal is to achieve the correct visual appearance.

Answer №1

The graphical element in question does not feature a shadow within, rather it showcases a seamless blend from white to gray in the background. For more information, you can explore this resource.

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

Let's experiment with creating a horizontal bootstrap form featuring three columns

I am struggling to create a horizontal form with three fields due to the space issue between the label and input type elements. My goal is to minimize the space between the label and input. Here is the HTML code snippet: <div class="container-flu ...

Dispatch keystrokes to a designated text field if they are not taken in by any other input

Is there a way to achieve the functionality seen in apps like Discord, where users can type into the message box even when it's not in focus? I am interested in implementing this feature only if no other input field on the page is currently focused. ...

clicking within the entire div space

This issue remains unresolved.. it has simply been avoided.. so do not rely on this as a reference Here is what I have: <div> <img onclick='this.style.display="none";this.parentNode.getElementsByTagName("div")[0].style.display="block";t ...

The background extends beyond the confines of its container

I'm facing some challenges trying to create this specific layout, particularly with setting a background that should cover 50% of the screen size. My initial thought was to use an image as the background, but I need different colors for each page. ht ...

json_encode has stopped functioning (now)

Recently, I encountered a strange issue. I've been trying to display chart data, but the JSON_ENCODE function that is supposed to convert my data into JSON format is not returning anything. It was working fine before when I had less data, but now it&a ...

What is the best way to align buttons and text using bootstrap?

Having an issue with misaligned text and buttons on my HTML page that is using Bootstrap. How can I align the buttons, image, and text properly? https://i.sstatic.net/6F9Z9.png <!doctype html> <html> <head> <link rel=" ...

What is the process of linking this JavaScript code to an outer stylesheet and integrating it with the HTML document?

After encrypting an email address using Hiveware Enkoder, the result can be found below. obfuscated code I typically include it directly inside the div as is. However, I would like to streamline my code by placing it in an external file. While I know ho ...

Is it possible to customize the borders of boxes in Google Charts Treemap?

Although this may seem like a minor issue, I can't find any information in the documentation. I'm currently using Google Charts treemap for monitoring a specific project. The problem I'm facing is that when all the parent level rectangles ar ...

Organize text documents for website display

Is there a way to code a website that will showcase the 20 most recent text files from a directory, in descending order of newest to oldest, and provide links for viewers to access them on the web? ...

Updating a class within an AngularJS directive: A step-by-step guide

Is there a way to change the class (inside directive) upon clicking the directive element? The current code I have updates scope.myattr in the console but not reflected in the template or view: <test order="A">Test</test> .directive("test", ...

How to Make a Sticky Footer Using a footer.php File

Looking to create a sticky footer using an external footer file? Including a footer.php file in the main page and making it sticky can be achieved by utilizing the wrapper tag strategy, demonstrated below in the example codes. <div class="wrapper"> ...

Get rid of the rollover effect on the <a> tag when hovering over an image

I have a snippet of code that is fully functional. <div class="user-pic round-pic"> <a href="<?php echo $userLoggedIn; ?>"><img src="<?php echo $user['profile_pic']; ?>"></a> </div> The issue lies in i ...

Is there an issue with this hyperlink? `<a href="#" onclick="getNextPage();">next></a>`

In my main.js file, I create a link that is supposed to call the function getNextPage. However, it seems to be scrolling my browser upwards instead. Even using <a href="javascript:getNextPage();"> doesn't seem to work. Interestingly, if I dire ...

Achieving Text Centering in kableExtra Cells with CSS: A Step-by-Step Guide

Recently, I received a helpful solution that involved using the extra_css = argument in cell_spec() from the kableExtra package. This allowed me to fill the entire cell of my table instead of just the text inside it. However, even after specifying align = ...

Issue with Django URLs: Error when trying to match routes

I have recently made changes to some of the URLs in my app, and now I am encountering an error when trying to render my index page. Can someone help me identify the issue? I have already checked for typos in my HTML file. The error message I am receiving i ...

What could be causing the content to disappear when switching from flex: column to flex: row?

In the code snippet provided below, you may notice that when the screen size is less than 768px, the video and content underneath it are visible. However, as soon as the screen size exceeds 768px, the video disappears. Have you ever wondered why the video ...

Why won't Firefox display images on my website?

Currently facing an issue with a website I am designing using HTML/CSS (design only). When I open it in Firefox from my hard drive, no images are displayed - instead, there is a small icon indicating that the picture could not be loaded. However, if I righ ...

What is the process for setting up both an open and closed status for my accordion?

After browsing through multiple threads on accordions, none seem to match my current structure which I believed was effective. In an attempt to learn and build elements from scratch, I created the following accordion with some help from Google and experi ...

Storing a Business Hierarchy in Browser Storage with JavaScript

I have developed a hierarchical tree structure on an HTML page where users can customize a company's organizational chart based on their needs. However, I am looking to store this structured data in local storage so that it can be utilized on another ...

JavaScript is being hindered by IE6 from setting attributes

document.getElementById("gD" + gDay + gMonth + gYear).classList.add("gDayHover"); While this code works perfectly in modern browsers, I am facing an issue with older versions. Specifically, when running IE8's compatibility mode, the code doesn't ...