Issue with Bootsrap 4 Dropdown Menu Displaying Incomplete Links

There seems to be an issue with the Bootstrap 4 dropdown menu not displaying all the links. Please refer to the image below:

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

The dropdown menu is not showing beyond the red band. I can't seem to figure out what I'm missing. Is there something I'm overlooking?

.red-block{
  height: 220px;
  background-color: red;
}
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
        <div class="container-fluid no-padding mt-3">
      <div class="row no-gutter">
        <div class="col-md-6">
          <div class="red-block ">
             <div class="title">
                <div class="light-title text-uppercase ml-20 mr-5 pt-5 ">
                   <h4 class="text-left">our <span>Services</span></h4>
                   <hr class="light" align="left" style="width:22%;">
                 </div>
                 </div>
                 <div class="dropdown ml-20">
                  <button type="button" class="btn btn-secondary text-uppercase dropdown-toggle" data-toggle="dropdown">
                    State
                  </button>
                    <ul class="dropdown-menu">
                    <li><a class="dropdown-item" href="#">Link 1</a></li>
                    <li><a class="dropdown-item" href="#">Link 2</a></li>
                    <li><a class="dropdown-item" href="#">Link 3</a></li>
                  </ul>
                </div>
          </div>
        </div>

<!-- begin snippet: js hide: false console: true babel: false -->

**

It appears that "Link 3" is not visible. Can someone help correct this?

Answer №1

Could you please share your complete code with me? Regardless, I suggest trying out my code to see if it resolves the issue. In my code, I have updated your div and anchor elements to utilize a ul - li - anchor structure.

Once you've tried it, let me know if it makes a difference.

    <!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title></title>
  <meta name="author" content="">
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  <script src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
  <link rel="stylesheet" type="text/css" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
</head>
<body>
  <div class="dropdown ml-20">
   <button type="button" class="btn btn-secondary text-uppercase dropdown-toggle" data-toggle="dropdown">
     State
   </button>
     <ul class="dropdown-menu">
     <li><a class="dropdown-item" href="#">Link 1</a></li>
     <li><a class="dropdown-item" href="#">Link 2</a></li>
     <li><a class="dropdown-item" href="#">Link 3</a></li>
   </ul>
 </div>
</body>
</html>

Answer №2

Consider incorporating the following code snippet into your CSS:

It's uncertain whether this code will be effective within your HTML document.

.dropdown-menu{
  position: relative;
  z-index: -1;
}

Answer №3

At times, you may encounter an issue where an element cannot be displayed properly due to being outside a container with the property overflow: hidden. To address this problem, you have a couple of options:

Option 1: Check for any elements with overflow: hidden and modify them.

Option 2: Reposition the .dropdown element adjacent to div.red-block as shown below:

HTML

 <div class="container-fluid no-padding mt-3">
  <div class="row no-gutter">
    <div class="col-md-6">
      <!-- RED BLOCK -->
      <div class="red-block ">
        <div class="title">
          <div class="light-title text-uppercase ml-20 mr-5 pt-5 ">
            <h4 class="text-left">our <span>Services</span></h4>
            <hr class="light" align="left" style="width:22%"/>
          </div>
        </div>
      </div>
      <!-- END RED BLOCK 
       DROPDOWN -->
      <div class="dropdown ml-20">
          <button type="button" class="btn btn-secondary text-uppercase dropdown-toggle" data-toggle="dropdown">
            State
          </button>
          <ul class="dropdown-menu">
            <li><a class="dropdown-item" href="#">Link 1</a></li>
            <li><a class="dropdown-item" href="#">Link 2</a></li>
            <li><a class="dropdown-item" href="#">Link 3</a></li>
          </ul>
        </div>
    </div>
<!-- END DROPDOWN -->

CSS

.red-block{
  background-color: red;
  height: 220px;
}
.dropdown.ml-20{
   position: absolute;
    bottom: 25%;
}

I trust this solution proves beneficial.

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

When CSS Display table is resized at media query breakpoints, it causes other cells to disappear

This is a discussion on creating a responsive image gallery website with images of different sizes and no margins or paddings. The issue at hand is that the .showcase class hides at a specific @media breakpoint when resizing, but there is a desire to displ ...

Can I use the mouseover event on an image to display a sibling div?

Hi everyone! I'm fairly new to web development and I could really use some advice. I'm trying to implement a mouseenter event on an img tag to show a sibling div, but I'm encountering some strange behavior. The mouseenter event seems to be w ...

Preventing page refresh when typing in a form input: Tips and tricks

I'm currently puzzled by a small issue. In my web application, I have a chat box that consists of an input[type='text'] field and a button. My goal is to send the message to the server and clear the input field whenever the user clicks the b ...

Struggling to pass Chai tests with Node and Express.js when trying to handle POST requests

Working through a Chai testing exercise and struggling to pass the POST route tests. Encountering two specific errors: 1) Todo API: POST /v1/todos Issue with creating and returning new todo using valid data: Header 'location' should ...

What is the process for setting up nested routes using React router?

I have multiple layouts that need to display different screens. Each layout has its own header, footer, and other shared elements similar pages should have. Below is the code I have created: <BrowserRouter> <Route path={['/index', &ap ...

You cannot reassign NodeJS global variables

Currently, I am in the process of writing unit tests for code that utilizes a JavaScript library. This particular library sets a global variable if it does not already exist using the following pattern: var GLOBAL_VAR = GLOBAL_VAR || {} While this method ...

Obtain information from YouTube and format it into a list item

Currently, I'm working on compiling a list of videos that includes the title, link, image, and creator of each video. It's been a bit challenging :S <script type="text/javascript"> $(document).ready(function(){ $.getJSON('http://gdata ...

Exploring custom JavaScript with Construct 2's generated code

How can I access the score of a game user in Construct2 Engine using external JavaScript? Is there a method to achieve this? Appreciate any guidance on this matter. ...

Hovering over the image causes it to flicker and it remains the same

I have an image column within a grid, where the images are displayed at 25px x 25px to fit nicely in each row. I've added a hover effect to the images so that when you hover over them, they shift left (which is working) and then expand for better vis ...

Implementing Validation for DropdownChoices and Checkboxes in Wicket Java

There is a checkbox and dropdown menu on an HTML page. Upon clicking submit, if both are selected, there should be an error message stating that at least one of them is mandatory and prompting the user to select at least one value. To address this issue, ...

The font weight is failing to take effect

I'm having an issue with the font-weight in my CSS. On my website, I'm trying to decrease the font-weight but even the lightest weight (100) looks too heavy like this: https://i.stack.imgur.com/6dwFa.png However, I want it to look more like this ...

Require assistance in understanding JSON data in the form of a variable

Apologies for any language barriers, but I have encountered a problem that I need help with. I am trying to create a highchart from an AJAX call. The following code works perfectly: chartOptions = { chart: { renderTo: 'grafica1', type: 'ar ...

"Obtaining Data from Local Storage on a Different Page: A Step-by-

``How can I transfer JSON data stored in local storage from one page to another within the same domain? In MainPage.html, the "user" data is stored in local storage and displayed. However, when data is added in AddEmploye.html and then returning to MainPa ...

Arrange various Div elements of varying sizes in a predetermined sequence

I need to ensure that a large div maintains the same height as 20 other divs within the same container, when the screen size is between 1024px and 1920px in width. The challenge lies in arranging all these items in a floated layout grid that looks clean a ...

CSS3 animation for rotating elements

If I have this box in CSS3 (also if, for what I understand, this is not CSS3, just browsers specific) : HTML <div id="container"> <div id="box">&nbsp;</div> </div> ​ CSS Code #container { paddin ...

The intended functionality of clicking on an image is exclusively reserved for its immediate parent element

I have a feature on my website that displays an image gallery. When a user clicks on an image, it opens up the image in full screen similar to Facebook's theatre mode. I have written code so that when the user clicks anywhere in the container of the i ...

Issue with Stack Divider not appearing on Chakra UI card

I'm currently designing a card element using Chakra UI. However, I've noticed that the Stack Divider in the Card Body isn't displaying as expected. Is there a specific way it needs to be structured for it to show up? For example, should I se ...

Adding multiple elements with varying content to a separate division

I am attempting to combine two div elements into a single div, but I'm encountering difficulties. Despite thoroughly examining my code, everything appears to be correct. Here's what I've tried so far. To assist me in achieving this, I am ut ...

Encountering an issue with connecting nodejs to mqlight

I have been working with nodejs and mqlight to test out some sample code provided on https://www.npmjs.com/package/mqlight. My current setup consists of nodejs 5.5.0 and npm version 3.3.12. To install mqlight, I used the command npm install mqlight. ...

A division of text is colliding with a division that holds a list with no particular

Hello everyone, I am new to HTML/CSS and I am facing an issue that I believe can be easily resolved. Currently, my code has four sections, with the last three displaying as expected in a consecutive manner. However, the second section is overlapping on t ...