Selecting the dropdown option reveals a blank white box on the screen

I have encountered an issue with my navigation bar code. Specifically, when I click on the Users dropdown in the top navigation bar, I am not able to see any items in the sub-menu:

      <nav>
    <ul>
        <li><img style="margin-right:20px;font-family:sans-serif" class="logo" src="~/Images/Logo.png"  width="60" height="60" runat="server" /><span style="font-size:20px">company Name</span> </li>
        <li style="margin-right:30%">&nbsp;</li>
       <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Users
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
          <a class="dropdown-item" href="#">Details</a>
          <a class="dropdown-item" href="#">Department</a>
          <a class="dropdown-item" href="#">Sections</a>
        </div>
      </li>
        <li><a href="#">Admin</a></li>
        <li><a href="#">Two</a></li>
        <li><a href="http://google.com/">One</a></li>
    </ul>
</nav> 

For reference, below is the stylesheet being utilized:

 <style>
body {
    margin: 0;
    padding: 0;
    font-size: 15px;
}

nav {
    background-color:darkcyan;
    margin: 0;
    overflow: hidden;
}

nav ul {
    margin: 0;
    padding: 0;
}

nav ul li {
    list-style-type: none;
}

nav ul li a {
    color: white;

    display: block;
    line-height: 3em;
    padding: 1em 3em;
    text-decoration: none;
}

nav ul li a.logo {



}



li {
    float:left;

}

li:first-child {
    float: left;
}

        </style>

Upon clicking on the dropdown for users, I am seeing a white box instead of expected content. Here is what it looks like:

https://i.sstatic.net/tGEev.png

Any assistance or guidance regarding this issue would be greatly appreciated. Thank you.

Answer №1

The issue occurred due to the fact that the nav element had the property overflow set to hidden, causing the dropdown list to be cut off. To fix this, simply remove this rule from the styles and leave the code as follows:

nav {
    background-color: darkcyan;
    margin: 0;
}

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

Manipulating CSS rules using JavaScript/jQuery

My goal is to create a function that generates a grid based on table data. While the function itself seems to be working, I am encountering an issue where the classes applied are not resulting in any style changes. Below is a snippet of my function: $(doc ...

Unique float structure within a division of divs

Can divs be floated within another div like this? Here is the code: <div class="event_month"> <div class="event1">1</div> <div class="event2">2</div> <div class="event3">3</div> <div class="event4">4</di ...

Is there a way to conceal or eliminate the search form from the webpage in Bootstrap 4 by simply clicking a button?

Is there a way to make the search form and Search Button disappear from the page, as they will be replaced by a Thank you message? <div class="row"> <div class="col"> <!-- ## SEARCH FORM ------------------- ...

The HTML embed element is utilized to display multimedia content within a webpage, encompassing

Currently, I am working on a static website for my Computer Networks course. Students need to be able to download homework files in PDF format from the website. I have used embed tags to display the files online, but I'm facing an issue where the embe ...

Creating a CSS button that spans multiple lines within a paragraph while maintaining the appearance of an anchor tag, even in

UPDATE: The solution provided by @Dinesh karthik works well, but unfortunately it does not support IE11. I am trying to make it compatible with IE11 as well. Is there a way to make a button look like an anchor tag within a paragraph? I want the button to ...

Adjusting the opacity of images in a Bootstrap 4 Jumbotron without affecting the text

Is there a way to apply an opacity of 0.5 to only the background image in my jumbotron, without affecting the text? Currently, when I set the opacity for the background, it also affects the text. How can this be resolved? Below is the custom CSS file: .j ...

The mouseover animation doesn't reset to its original position during quick movements, but instead continues to move without interruption

Greetings! Welcome to my live page. Currently, I am facing an issue with the sliding animation on the header. Specifically, the small gray slide-up divs at the bottom of the sliding pictures are not behaving as expected. They are meant to slide up on mous ...

Using Css3 to adjust styling based on device width and orientation

I am trying to create a background color that changes based on the orientation of the device. Here is the code I have been using: <meta name="viewport" content="width=device-width"> ... @media all and (max-device-width: 360px) { div { background- ...

Text randomly appears on the html page

I've been dedicating a significant amount of time to finding a solution, but haven't had any luck. I'm aiming to create a visual effect where 10 words with varying font sizes slide in from different directions on a canvas within my document ...

What is a CSS drop-down menu/container?

I've been brainstorming a unique dropdown menu style that involves dropping down a container, but I'm a bit stuck on how to execute it effectively. Although I've outlined the basic concept, I'm still unsure of the implementation. Any t ...

Steps for printing a web page with a custom stylesheet instead of the default print.css file

I have a print.css file that handles printing website pages, but I now want to create a basic-print.css file specifically for printing out basic information. How can I add a button to the page that triggers the print functionality using basic-print.css ins ...

What is the best way to resize a primefaces inputTextArea to match the length of the

I am currently working on improving the appearance of <p:inputTextArea/>. When the page loads, I notice: And when I click on that TextArea: Here is the code: <p:inputTextarea rows="6" value="#{bean.object.value}" style="width: 100%;" /> Is ...

What purpose does '& .MuiTextField-root' serve within the { makeStyles } function of Material UI?

I've been working on a React JS project using Material-UI and came across some interesting styling in my Form.js file. Here's a snippet of the code: import useStyles from './styles'; const classes = useStyles(); <form autoCapitali ...

I have been attempting to implement validation in JQuery, but it doesn't seem to be functioning correctly

Can someone assist me with adding validation in jQuery? I'm stuck and need help solving this problem. $(function(){ $("#btn").click(function(){ var b=prompt("Enter your link"); $("a").attr("href",b); if($("b").v ...

Building a Responsive Page with Bootstrap 4

I'm currently working on a design page with 2 boxes on the left side and 3 boxes on the right. It looks great on desktop, but I want the boxes to display individually on mobile devices and I'm having trouble figuring it out. Here is my code: < ...

The callback function fails to execute the click event following the .load() method

Hey there, I've hit a roadblock and could really use some help figuring out where I went wrong. Let me break down my script for you. On page1.html, I have a div that gets replaced by another div from page2.html using jQuery's .load() method. Here ...

I want to show error messages using jquery only when the username or password is entered incorrectly. How can this be achieved?

document.getElementById("buttonClick").addEventListener("click", mouseOverClick); function mouseOverClick(){ document.getElementById("buttonClick").style.color = "blue"; } $("#buttonClick").hover(function() { $(this).css('cursor',&apos ...

Increment the counter value by one when a new class is created or appended

My goal is to develop a system that increments the 'fault' counter by one every time a wrong answer is submitted. To achieve this, I have configured my system to detect when a class named "incorrectResponse" is generated. However, I am encounteri ...

Slice cleanly through the heart of the boundary

I want to create a unique border effect when hovering, similar to the one shown in this image: https://i.sstatic.net/JsXVJ.png I'm not quite sure how to define this border style. Any suggestions on how to achieve it? .text { width: 100px; hei ...

Borders in my CSS/HTML table design

Hey, I'm currently facing an issue with my class project. I've created a table with a series of images to form a background image. However, there are borders on the table that I need to adjust. Here is the current look: I am trying to have a sq ...