elevate the shadow of the menu bar above the background image

How can I ensure that the drop shadow of the menu appears in front of a background image within a div?

See below for my CSS code

nav {
    width:900px;
    margin: 4px auto 0px 8%;
    font-size: 16pt;
    padding-bottom: 0px;

  -moz-box-shadow:    7px 8px 3px 1px black;
  -webkit-box-shadow: 7px 8px 3px 1px black;
  box-shadow:         7px 8px 3px 1px black;
}

.mainContent {
    margin: 0px auto;
    width: 1200px;
    height:100%;
    padding-top:0px;   

    background-color: #0e23a4;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#0e23a4), to(#999999));
    background-image: -webkit-linear-gradient(top, #0e23a4, #999999);
    background-image: -moz-linear-gradient(top, #0e23a4, #999999);
    background-image: -o-linear-gradient(top, #0e23a4, #999999);
    background-image: linear-gradient(to bottom, #0e23a4, #999999);   

  -webkit-box-shadow: 0px 15px 9px 8px black;
  box-shadow: 0px 15px 9px 8px black;

}

.bodyMain {
    width: 100%;
    height:100%;

    border:1px solid white;
    background-image:url("/Content/images/phoenix.jpg");
}

HTML

    <nav>
        <ul id="menu1">
            ...
        </ul>
    </nav>
    <div class="bodyMain">
        <div class="mainContent">
            ...
        </div>
    </div>

Answer №1

One solution could be applying a z-index:9; to your navigation element.

By doing so, you can ensure that the navigation section appears on top of other elements.

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

Is there a way to alter the color of a button once it has been clicked?

For a school project, I am working on coding a website to earn extra credit. My goal is to create a fancy design that stands out. One of the main things I am trying to achieve is having a button change color when it is clicked, similar to how it highlight ...

Trouble with the Rotate <text> feature in Internet Explorer 11 on Windows 10

I am using d3.js to draw SVG with the transform:rotate(180deg) property. It displays perfectly on Chrome, but doesn't work on IE11. I tried changing it to rotateY(180deg), and it works with div elements but not with text elements. Here is my screen an ...

The first table can be located using basic HTML parsing with simple html dom

When using simple html dom to extract ids from a table, here's what my tables are structured like: <table> <a name="Module-277409-Start_5f7bad2c-10af-4c88-afaf-6c960be2f547"></a> <a name="Module-277409-Start"></a> < ...

Enhance the appearance of the circular heading

Is there anyway to customize the look of this rounded header? I am having trouble setting a white background. Update #1: This is my current header HTML code: Here is how it currently appears: I utilized Bootstrap along with some custom CSS. Update #2: ...

javascript - determine whether a hyperlink has been accessed

Is there a method to determine if a link has been visited? In Firefox, the color of a link changes after clicking on it, which leads me to believe it is possible. Edit: This question pertains to a Firefox extension, so I am unable to modify the HTML or CS ...

Using Angular within an XML Namespace does not automatically bootstrap using ng:app attribute

Despite Angular allowing the use of an xmlns and ng: instead of ng- for backwards compatibility with IE, it seems that not all directives in xhtml are supported <?xml version="1.0"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xht ...

How to eliminate spacing on the left side of a Bootstrap button

Why is there a space before my first button and how can I remove it? <div class="container"> <div class="row"> <div class="col-xs-4 col-md-3"> <button @onclick="ShowModal" class="btn btn-primary"><i class="oi oi-plus ...

Limit text to two lines inside a cell in a table

Apologies for not providing any evidence of my own efforts. I'm looking to wrap text in a table cell, but limit it to just 2 lines. Expanding the width is not possible. Any suggestions on how to achieve this? ...

Every time you attempt to download in Vue, you are met with the familiar sight

Encountering a peculiar issue while attempting to download an apk file using a Vue.js website: Referring to How to download a locally stored file in VueJS, I am trying to download a local file with this command: <a href="../../app-debug.apk" download= ...

When an HTML element extends beyond the screen's right boundary, it becomes truncated

My website utilizes a table to showcase some data, but there's an issue when viewed on smaller screens. The table gets cut off and not all the content is visible. Even after scrolling completely to the right, the rightmost field remains barely visible ...

Displaying a Color Sample in a Grid

I'm currently working on a feature that allows users to select colors using the jQuery minicolor widget. I really like how the color swatch appears inside the widget, but I'm having trouble replicating that same look in a data table. When I try t ...

Can HTML tag attributes be accessed in CSS within the Shadow-DOM?

As I work on developing a custom component using StencilJS, I find myself needing to adjust the outline behavior when users navigate through it with either a keyboard or mouse. My component employs ShadowDOM and I aim to extract an HTML tag attribute from ...

Performing calculations on PHP and MySQL data within an HTML table, enabling precise percentage

Here's the code I'm currently working with: <td> <?php echo $row['feild1'] + $row['feild2'] + $row['feild3'] + $row['feild4'] + $row['feild5'] + $row['feild6'] + $row[' ...

Using jQuery to select the child element of the parent that came before

Recently, I've been experimenting with creating animations using CSS and jQuery. While it has been successful so far, I'm now looking to take it a step further. Specifically, I want information to appear on top of an image when the user clicks on ...

Could there be an issue with my website's bootstrap where badges are not being applied properly?

Currently, I am in the process of learning ReactJS and running into an issue where my bootstrap is not working within my .jsx file. Despite following a tutorial (MOSH) diligently and extensively researching on stack overflow, I have not been able to find a ...

Tips for customizing the base font size in a Bootstrap 4 template

My Java/Spring Boot webapp utilizes Thymeleaf HTML page templates and Bootstrap 4, with the foundation being a free Bootstrap 4 site template called 'Simple Sidebar': . The current setup is functioning smoothly for me. I am interested in adjusti ...

Translucent overlay enhancing image contrast

Currently, I have a container with a background image that turns semi-transparent on hover. Below is the simplified version of my HTML: <div class="container"> <div class="overlay"></div> <img src="hi.jpg"> </div> This ...

Select checkboxes by clicking a button that matches the beginning of a string in JavaScript

I have a form with a list of users and checkboxes below their names. Each user has a button that should select all checkboxes assigned to them. Below is the code for the dynamically created buttons and checkboxes. The included function takes the form name ...

How can I display two slides at once in Ionic 2/3 on a wide screen?

I have been searching for a solution that will allow me to display 1 ion-slide if the device screen is small, but if it's larger, then I want to display 2 ion-slides. Unfortunately, I have not been able to find a suitable solution yet. As an example, ...

Display a symbol retrieved from the backend server

After receiving a response from the backend server for my Angular 2/4 application, I am presented with an attribute called "connectionStatus". This attribute indicates the status of a database connection, either as "UP" or "DOWN". In order to display this ...