Display the Bootstrap dropdown menu on the right-hand side

I am currently working on a dropdown menu and I would like the dropdown items to be displayed on the right side. The functionality is working, but there seems to be an issue where the dropdown menu is not fully visible. The dropdown menu is located within a sidebar, and when the space in the sidebar is insufficient, it cuts off half of the dropdown items.

Here is a snippet of my code (please excuse the inline CSS):

<div class="dropright">
    <button type="button" class="" style="background: none;
      color: inherit;
      border-top: 1px solid white;
      border-bottom: 1px solid white;
      border-left: 0;
      border-right: 0;
      padding: 10px 12px;
      font: inherit;
      cursor: pointer;
      align-items: center;
      width: 80%;
      outline: inherit;" 
      data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Items
    </button>
       
<div class="dropdown-menu" x-placement="right-start" 
      style="position: absolute; 
      transform: translate3d(111px, 0px, 0px); 
      top: 0px; 
      left: 0px; 
      will-change: transform;">
    <a class="dropdown-item" href="#">Action</a>
    <a class="dropdown-item" href="#">Another action</a>
 </div>

</div>

The issue can be seen in the images below, where half of the dropdown menu is hidden:

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

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

Additionally, here is a snippet of my sidebar code:

<div class="main-menu menu-fixed menu-dark menu-accordion menu-shadow" data-scroll-to-active="true">
<div class="main-menu-content">
        <ul class="navigation navigation-main" id="main-menu-navigation" data-menu="menu-navigation"
            data-icon-style="lines" style="position: relative">

            <li class=" navigation-header"><span>SUPER ADMIN</span>
            </li>

            <li class=" nav-item"><a href="{{ route('home') }}"><i class="menu-livicon"
                data-icon="line-chart"></i><span class="menu-title" data-i18n="home"><span
                    class="menu-title" data-i18n="home">Dashboard</span></a>
            </li>
     
            <div class="dropright">
                <button type="button" class="" style="background: none;
                color: inherit;
                border-top: 1px solid white;
                border-bottom: 1px solid white;
                border-left: 0;
                border-right: 0;
                padding: 10px 12px;
                font: inherit;
                cursor: pointer;
                align-items: center;
                width: 100%;
                outline: inherit;" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                 Items
                </button>
                <div class="dropdown-menu" x-placement="right-start" style="position: absolute; transform: translate3d(111px, 0px, 0px); top: 0px; left: 0px; will-change: transform;">
                  <a class="dropdown-item" href="#">Action</a>
                  <a class="dropdown-item" href="#">Another action</a>
                </div>
              </div>

               
        
            <li class=" navigation-header"><span>MENU</span>
            </li>

    <li class=" nav-item"><a href="{{ route('home') }}"><i class="menu-livicon"
                data-icon="line-chart"></i><span class="menu-title" data-i18n="home"><span
                    class="menu-title" data-i18n="home">Data Master</span></a>
            </li>

         
        </ul>
    </div>
</div>

Answer №1

Is it possible to correct the issue by including z-index: 10; in the dropdown-item class?

Alternatively, you could use inline CSS like this:

    <a class="dropdown-item" style="z-index: 10;" href="#">Action</a>
    <a class="dropdown-item" style="z-index: 10;" href="#">Another action</a>

Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index

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

Styling the topbar with CSS includes adding a vertical separator that neatly wraps the content within the

I recently created a website using HTML and CSS, featuring a topbar. However, I encountered an issue while trying to insert a vertical separator between some of the icons within the topbar. Initially, when I added the separator-div, only the first three ic ...

PHP multiple file uploads can allow users to upload and

Can anyone help me with a problem I'm facing? I built a file uploader that works fine until I try to save the uploaded file name in a database. When I attempt to do so, I receive this error message: Warning: mysql_real_escape_string() expects para ...

The out directory is lacking Styled JSX integration for Next.js

I have a straightforward project in NextJs and I am looking to serve the files via NginX. Here are the dependencies listed in my package.json file: "dependencies": { "isomorphic-unfetch": "^2.0.0", "next": "^7.0.2", "next-routes": "^1.4.2", ...

What should I designate as the selector when customizing dialog boxes?

I am attempting to change the title bar color of a dialog box in CSS, but I am running into issues. Below is the HTML code for the dialog box and the corresponding CSS. <div id="picture1Dialog" title = "Title"> <p id="picture1Text"> ...

Guide to aligning a URL in an HTML file

Greetings all, I'm new to HTML and struggling with how to center a URL on my webpage. For example: <a href="http://www.google.com"> Click Here to Open Google </a> I attempted using the tag and the STYLE attribute but without success. ...

Retrieve a collection of CSS classes from a StyleSheet by utilizing javascript/jQuery

Similar Question: Is there a way to determine if a CSS class exists using Javascript? I'm wondering if it's possible to check for the presence of a class called 'some-class-name' in CSS. For instance, consider this CSS snippet: & ...

Styling a div to wrap around an image

I'm working with an image element that has the style attribute set to style='width:40%;height:40%'. My goal is to add a div around this image that will automatically adjust its size to wrap around the image. However, when I try inserting the ...

Implement a customized toString method for components in ReactJS

Looking to modify the toString method of a class component in reactjs? Check out the code snippet below class C1 extends React.Component{ render(){ return ( <div> {C2.toString()} </div> ) } } class C2 extend ...

Unresolved issue with AngularJS radio button binding

As a beginner in using Angular.js, I encountered an issue with data binding when dealing with radio buttons. The HTML code in question is: <label class="options_box" ng-repeat="item in item_config_list.item_config"> <input type="radio" name ...

Shiny Chrome, Flexible Flexbox, and plump div elements

Looking to enhance my understanding of flexbox. Encountering a display issue in Chrome where the right column is too wide and the left column is too skinny, while it displays correctly in Firefox. Any suggestions on how to fix this for Chrome? .child ...

Ways to showcase a div exclusively on UC mini browser

I'm looking for help to create a script that will only display a div with the class "info-box" in UC Mini browser. This div should be hidden in all other browsers. Can someone assist me with this? <!doctype html> <html> <head> <m ...

Using radio buttons to toggle the visibility of a div element within a WordPress website

I am currently working on creating a WordPress page using the custom page tool in the admin interface. My goal is to have 3 radio buttons, with 2 visible and 1 hidden. The hidden button should be automatically checked to display the correct div (although ...

Obtaining a list of child span elements using xpath in Selenium

I am looking to retrieve all child span elements based on the following xpath //label[@for='someText']/span Expected result: <span class="someClass">"Find this text"</span> <span id="someId">" ...

Tips for sending all form elements via ajax without explicitly mentioning their names

I'm developing an application with a dynamic form generation feature. When a button is clicked, I need to send all the form elements to another page using Ajax. The challenge is that since the form is generated dynamically, I am unable to specify elem ...

If every single item in an array satisfies a specific condition

I am working with a structure that looks like this: { documentGroup: { Id: 000 Children: [ { Id: 000 Status: 1 }, { Id: 000 Status: 2 ...

Issue with jQuery select box (roblaplaca) and its custom scroll bar functionality not functioning as expected

Recently, I implemented the custom select box script from . This script allows for two select boxes, where the second one updates dynamically using AJAX when there is a change in the first select box. Below is a sample of the HTML code: <option>One& ...

Sending a file through an Ajax POST request to a PHP server

I am attempting to upload the HTML input file to my PHP file using a different method than the traditional synchronous HTML forms. The problem I am encountering is that it seems like I am not correctly POST'ing the input file to my PHP file because t ...

Securing containers with CSS styling

I'm currently working on a website and I've encountered an issue with positioning. Within the content section, I have two main text boxes - one in the top left corner and one in the bottom right corner. However, when the browser window is resized ...

Place an animated object in the center with the display style set to

I'm trying to vertically center the second span within my H1. After attempting to change from display: inline-block to display: flex, I found that this causes my animation to start at the beginning of the container rather than in the center. I suspe ...

What is the best way to align my logo image and search field at the center of the page, similar to the layout of

Struggling with styling this webpage. I aim to have my logo and search bar centered on the page, surrounded by ample space above and below. You can check it out at NE1UP dot com. All I want is a Google-style layout for my page, but I'm facing difficu ...