Implementing a box-shadow effect on a particular navigation item

I'm currently working on my own website and I've run into a roadblock with the menu design. Here's how it looks right now.

https://i.sstatic.net/8kINJ.png

Everything is looking great except for one issue! I'm attempting to add a box-shadow effect to the "Blog" menu item, and upon zooming in, you'll notice the box shadow on the left side and on top of "Blog," but it doesn't appear on the right side. It seems like there may be an overlap with the "About" section.

The box-shadow code is correctly written as follows:

box-shadow: 0 0 10px 3px rgba(0,0,0,0.12);
-webkit-box-shadow: 0 0 10px 3px rgba(0,0,0,0.12);
-moz-box-shadow: 0 0 10px 3px rgba(0,0,0,0.12);

Here is the HTML snippet related to this issue:

    footer{
      bottom: 0;
      // height: 100px;
      left: 0;
      overflow: hidden;
      position: absolute;
      width: 100%;
    
      nav.main{}
    
      nav.main ul{
        list-style-type: none;
        margin-bottom: 0;
        padding-left: 0;
      }
    
      nav.main ul li{
        display: inline-block;
        float: left;
        line-height: 1;
        margin-top: 1.5rem;
        text-align: center;
        width: 20%;
      }
    
      nav.main ul li span{
        display: block;
        font-size: 5rem;
        margin-bottom: 1rem;
      }
    
      nav.main ul li a{
        color: #2D2D2D;
        display: block;
        font-size: 2rem;
        padding: 2rem;
      }
    
      nav.main ul li a.highlight{
        background-color: #ACFF32;
        box-shadow: 0 0 10px 3px rgba(0,0,0,0.12);
        -webkit-box-shadow: 0 0 10px 3px rgba(0,0,0,0.12);
        -moz-box-shadow: 0 0 10px 3px rgba(0,0,0,0.12);
    
        border-radius: 5px 5px 0 0;
        margin-top: -1.5rem;
        padding-top: 3.5rem;
      }
    }
<footer>
      <nav class="main">
        <ul>
          <li style="background: #33A2FF;">
            <a href="#">
              <span aria-hidden="true" data-icon="&#xec02;" class="icon icon-briefcase"></span>
              PROJECTS
            </a>
          </li>
          <li style="background: #22E886;">
            <a href="#">
              <span aria-hidden="true" data-icon="&#xe92e;" class="icon icon-bucket"></span>
              DESIGNS
            </a>
          </li>
          <li style="background: #ACFF32;">
            <a href="#" class="highlight">
              <span aria-hidden="true" data-icon="&#xe91c;" class="icon icon-pen"></span>
              BLOG
            </a>
          </li>
          <li style="background: #E8BA22;">
            <a href="#">
              <span aria-hidden="true" data-icon="&#xec27;" class="icon icon-brain"></span>
              ABOUT
            </a>
          </li>
          <li style="background: #FF6F25;">
            <a href="#">
              <span aria-hidden="true" data-icon="&#xea35;" class="icon icon-mailbox"></span>
              CONTACT
            </a>
          </li>
        </ul>
      </nav>
    </footer>

Furthermore, I noticed that if I set a background for the nav element and remove all colors from the menu items, the box shadow functions properly. Thus, defining colors separately seems to be causing the issue.

Thank you for your assistance.

Answer №1

To ensure the drop shadow remains on top, increase the z-index of the active tab compared to the others:

Simply include the following code snippet within nav.main ul li a.highlight:

position: relative;
z-index: 2;

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

Learn the best practices for incorporating jQuery and other JavaScript libraries in your Angular2 projects

Is it possible to integrate a demo showcasing Bootstrap carousel with CSS3 animations in Angular2 using HTML, CSS, and JS? I have created my own implementation in Plunker with Angular2, but I am facing issues with the animated inner content of the carousel ...

JavaScript innerHTML not functioning properly when receiving a response from a servlet

Can someone help me troubleshoot the code below? I'm receiving a response from the servlet, but I can't seem to display it inside the div. Here is the response: lukas requests to be your friend &nbsp <button value="lukas"onclick="accfr(th ...

What are some effective strategies for designing the HTML/CSS layout when utilizing Electron?

Are people usually keying in the values manually, or is there a user interface (UI) builder available that works like the drag-and-drop UI builders found in Android and iOS? Just like how many websites today utilize site builders rather than requiring ma ...

Using jQuery to create two identical widgets

Just starting out with JQuery and had a question about a specific problem I'm facing: Imagine you want to include 2 textboxes with datepickers on an HTML page using jQuery UI. Since jQuery works based on "ID" rather than "Class", the following code w ...

Adjust the angle of an object precisely using a transform upon hovering over a designated button

I am looking to design a menu that always keeps the arrow pointing at the button I hover over with my cursor. If I don't hover on any button, then it should stay in the position of the last button I hovered over. HTML: <html lang="en"> <hea ...

Obtain the value of a two-handle slider using jQuery

Here is the HTML and JS setup I have for implementing a jQuery two-handle range slider: .html <p> <input class="amount" readonly style="border:0; color:black; background: transparent; text-align: center;" type="text"> </p> <div cla ...

Header logo not showing up on webpage

While working on a website template for a friend, I encountered an issue when uploading the site. The logo image was displaying perfectly fine on my local drive, but once uploaded, it showed as a broken image icon on the live website. Here is the code sni ...

Tips for preventing labels from overlapping in JavaScript

After texturing an image to a sphere in 3D (as shown below), I encountered an issue where the planegeometry labels were overlapping. I am looking for a way to separate these labels using the three.js library. 2 labelBox.prototype.update = function() { ca ...

Is there a way to make Javascript function properly on the HTML content that is dynamically loaded onto the page using JSON?

For a specific page, I am utilizing json to load a section of html code that showcases details about the user's submission upon clicking something. In this scenario, the user is selecting their preferred baseball player, and the json data presents ht ...

JavaScript Game Engine - Code Runs Smoothly in the Editor! Encountering Errors in the Inspector?

Issue Resolved in Editor, But Errors Found in Inspector Upon completion of the game development, the document successfully ran in Dreamweaver and TacoHTML. However, when loaded into the w3 Inspector, several errors were detected related to tag styles and ...

Steps for inserting an image:

Looking for help adding a static header image to a simple HTML page that contains two div tags: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1 /DTD/xhtml1-strict.dtd"> <html> <head> ...

The outcome is not displayed in the appropriate section of the text

There seems to be an issue as the console is not displaying the response to the input, such as "the answer is correct" or "the answer is either empty or incorrect". <!DOCTYPE html> <html lang="en"> <head> <title>Hello!</ ...

How come there is a varying gap between the fixed header and the main content when the height is set to 10%?

I've noticed a peculiar issue when using percentage values for the height of my fixed header and margin-top of the main div. Everything works smoothly when I set the header height to 50px and margin-top of the main area to 50px. However, when I chan ...

Transmit the Boolean value to the controller using ajax requests in asp.net.core with C# programming

Within the view section, there is a form that includes a checkbox input. <div class="checkbox"> <label class="">active</label> <div class="icheckbox_flat-green checked" style="position: relative;"> <input type="checkbox" id="A ...

I'm having trouble getting CSS to apply to my HTML file. Any idea why?

I conducted tests in both Chrome and Firefox, ruling out any browser-related issues. My CSS has been validated and is error-free. However, when I validate my HTML code, an error message pops up stating "Bad value “stylesheet” for attribute rel on eleme ...

JavaScript: utilizing 'this' and onClick events

Recently, I created a basic slideshow with 4 images where upon clicking, the selected image displays in a larger div box. The functionality is quite straightforward, but if you have any queries, feel free to ask. As of now, with only 4 images in the slides ...

Transform your text color using CSS styling

I've been attempting to modify the color of the text in the tiles on the homepage of my website (). When you hover over, for instance, "IT-Service", that's the text I'm aiming to change the color of. I experimented with adding color: #ffff ...

Inject HTML from an external source into several div elements that share the same class

I am currently working on creating a portfolio showcasing my music albums through CD covers. On my portfolio page, I have all the content of my albums loaded initially, but it is hidden within divs. When an album is clicked, the content expands and colla ...

Utilize Flexbox to occupy the rest of the available space

I would like the center row to occupy the entire browser width just like typical websites. Even if there is minimal content, I want the middle row to fill up the whole space. Below is the CSS code: @import "compass/css3"; .wrapper { display: -webkit-b ...

Is there a way to extract and store all the href values from list items into a text file using iMacros?

Hey there! I'm diving into the world of imacros with version 12.0.501.6698 on Windows 10 Pro 20H2 - OS Build 19042.1110. My mission is to scrape all the href values from multiple list items in an HTML page and save them to a text file. The challenge ...