What is the correct way to enable overflow-y as visible while setting overflow-x to scroll within a div

How can I implement overflow-y: visible with overflow-x: scroll in my code?

The number of buttons may vary, and when there are too many, they should scroll horizontally. However, when I click the Dropdown button, I want to make sure that the dropdown lists are visible in the div. Currently, they are hidden within the div.

Any suggestions on how to achieve this?

Code Snippet:

HTML

  <div class="container-fluid fill-height">
      <div class="navbar navbar-expand scroll" role="group">
        <div class="dropdown">
          <button type="button" class="btn btn-default dropdown-toggle" id="testDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</button>
          <div class="dropdown-menu" aria-labelledby="testDropdown">
            <a class="dropdown-item" href="#">Menu</a>
          </div>
        </div>
        <!-- Buttons go here -->
      </div>
    </div>

CSS

.scroll {
  overflow-x: scroll;
  overflow-y: visible;
}

Take a look at the live sample on CodePen here

Answer №1

Just a quick note:

Referencing the official Bootstrap documentation (http://getbootstrap.com/components/#dropdowns-alignment): It's possible that additional positioning may be needed Dropdowns are positioned automatically using CSS within the regular document flow. This means they could potentially be cut off by parent elements with certain overflow settings or extend beyond the viewport boundaries. Make sure to address these issues as they come up.

For more information, visit:
https://github.com/davidstutz/bootstrap-multiselect/issues/411
https://www.bootply.com/YvePJTDzI0

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

``How can I align a drop-down menu to the right in a navigation bar?

I'm attempting to incorporate a dropdown menu into a navbar, but I'm encountering an issue where the icon is aligned to the right, but the menu opens to the left despite using dropdown-menu-right. I came across a note mentioning popper.js for pos ...

I am having trouble getting my bootstrap codes to run on my Django website. Can anyone help me figure

Hey there! Struggling with incorporating bootstrap into my django website. I've added the bootstrap link in the HTML page and inserted the navbar code in the body section, but upon running the server, the website remains unchanged! What could be ca ...

Modifying various items depending on the variable's value

I'm attempting to adjust various variables depending on which button the user clicks. For instance, there are three buttons: <button id="button1" onclick="isClicked(this.id)">B1</button> <button id="button2" onclick="isClicked(this.id) ...

Receiving the error "Potential null object. TS2531" while working with a form input field

I am currently working on developing a straightforward form to collect email and password details from new users signing up on Firebase. I am utilizing React with Typescript, and encountering an error labeled "Object is possibly 'null'. TS2531" s ...

A static method written in Typescript within an abstract class for generating a new instance of the class itself

Imagine I have abstract class Foo { } class Bar1 extends Foo { constructor(someVar) { ... } } class Bar2 extends Foo { constructor(someVar) { ... } } I want to create a static method that generates an instance of the final class (all construct ...

Dynamically remove the underline tag from a table cell

Within my HTML, I've inserted the code below for a cell: cell.innerHTML = "<u>View All</u>"; In my onclick event for the cell, I have this code (for example, it's based on a condition where I structure the content as shown below, no ...

Is there someone who can explain to me the process behind this?

(function(ng, app){ app = angular.module('app', []); app.config(function($provide) { $provide.constant('town', 'Burlington'); }); app.constant('name', 'Rob F.'); app.controlle ...

Vue: Develop a master component capable of displaying a sub-component

Is there a way to design a main component that is able to accept and display a subcomponent? Take the following scenario for instance: <Container> <Item/> <Item/> <SubMenu/> <Btn/> </Container> ...

Tracking in node.js to detect the creation of a new file

I'm currently working on a node.js script that requires immediate action upon the creation of a file with a specific name in a designated directory. While one way to achieve this could be through continuous calls to fs.readdir until the desired file i ...

Adjusting the size of Bootstrap alerts while ensuring the close icon remains correctly positioned

Below is the HTML code snippet I am working with: <div class="row mt-2"> <div class="col-lg-5"> <div id="alertmessages"></div> </div> <div class="col-lg-7"> <div class="btn-group-sm"> ...

What is the best way to cycle through a series of lists and retrieve the URL when a specific string is found within a class of the list

I'm new to JQuery and currently experimenting on JSFiddle to improve my skills for developing a web app I have in mind. One of the requirements I need to meet is iterating through lists on the page. If a specific class contains a certain string, I sh ...

Learn how to stream videos using the YouTube Player API's loadPlaylist feature

Is there a way to make the next video play automatically using the loadPlaylist option? I've tried implementing this code but unfortunately, it doesn't work and the video won't play: <div id="player"></div> <script> var ...

Combining formData props with Component state in React using Redux

Monitoring form input changes and saving them to the state in my Editor Component. Upon form submission, dispatching the formData from the state to the store. Upon Component reloads, intending to merge the prop's formData with the state. Attempted u ...

Receiving JSON data from the server, but struggling to render it as HTML using Jquery

Currently, I am in the process of developing a mobile app and have created a PHP API that extracts data from a MySQL database and encodes it into JSON format. To display the records from the JSON output, I use jQuery AJAX to call this API and render the d ...

Adaptive Table Layout that Creates a Page-breaking Design

I have a page layout with three columns: a fixed-width left-hand navigation, a responsive content column, and a fixed-width right-hand navigation. The issue arises when the content in the middle column includes HTML tables that sometimes exceed the availab ...

Issues with custom logo and menu/sidebar toggle on Wordpress

Hello everyone, I am currently facing some difficulties with my new WordPress blog that utilizes the Skilt-Theme. Specifically, I'm having trouble with the custom-logo and sidebar-toggle features. When there is no logo present, you can see the layout ...

Modifying background with JavaScript and AJAX技术

I currently have a table structured like the following; <table style="width: 100%; border: solid 1px #666600; min-width: 800px" cellpadding="0" cellspacing="0"> <tr> <td id="aaa">&nbsp;</td> ... Using jQuery's ajax functi ...

The system has detected an invalid NSStringEncoding value of 0x8000100 while converting NSAttributedString to HTML

I encountered a warning in the debugger while using XCode: It detected an incorrect NSStringEncoding value of 0x8000100 when converting an NSAttributedString to html data. I am unsure of what is causing this issue or how to resolve it. Below is the code sn ...

How can one accurately pair the key and its corresponding value from an array of objects to create a new object containing only that key?

In my JavaScript code, I am attempting to create a function that can match a specific key with an array of objects fetched from an API. This matching process is based on two parameters obtained from the API: a key (which is a string) and an array of object ...

Is it possible to make an element draggable after it has been prep

Seeking assistance with making a notification draggable when added to a webpage. The notifications are housed in a parent div named notification_holder Here is the structure: <div class="notification_holder"> <div class="container"><b ...