Utilizing a dropdown feature in Bootstrap for creating X columns of lists instead of a traditional single list

Check out my Fiddle.

Beneath Dropdown1 lies a single-column list of actions.

I'm looking to expand this list across multiple columns, like 5 or the width of the page.

I'm hoping there's a Bootstrap CSS class I can use for this, but I might need to tweak some CSS.

Any suggestions on how I can accomplish this?

<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false>Dropdown1 <span class="caret"></span></a>
  <ul class="dropdown-menu">
    <li><a href="#">Action</a></li>
    <li><a href="#">Action</a></li>
    
    ...
    
  </ul>
</li>

EDIT1

You can also try using this method:

.dropdown-menu {
    height: 300%;
    width: 400%;
}

However, this only adjusts the dropdown area, not the layout of the actions within it.

EDIT2

Alternatively, consider exploring another approach with its own set of challenges:

ul .dropdown-menu li{
    float: left;
    width: 50%; // Use this to determine the number of columns, e.g., 33.3% for 3 columns
}

Answer №2

If you are comfortable with specifying a width for the dropdown in your second example, consider including display: inline-block to the dropdown li elements.

.dropdown-menu li {
  display: inline-block;
}

View your updated fiddle here. Keep in mind that this change will impact your second dropdown as well, so it might be necessary to assign a custom class to the first one if you only want these specific modifications applied there.

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

Issue encountered when attempting to include jquery.min.js due to a jquery conflict

I've been experimenting with the jquery.scrollableFixedHeaderTable.js extension in order to create a table header that remains fixed as you scroll through the table. However, when I attempt to incorporate jquery.min.js for a tooltip plugin, the scrol ...

Attempting to dynamically update the image source from an array when a click event occurs in a React component

Has anyone successfully implemented a function in react.js to change the image source based on the direction of an arrow click? For instance, I have an array set up where clicking the right arrow should move to the next image and clicking the left arrow s ...

Running a continuous JQuery function loop

I need assistance with creating a continuous image fade in and out effect. Currently, my code looks like this: $(document).ready(function(){ $(".slider#1").delay(1000).fadeIn(2000); $(".slider#1").delay(1000).fadeOut(2000); $(".sli ...

Is it necessary to download and install plotly if I am using the cdn in my HTML file?

I'm currently developing an online application using Flask. The user input is collected with d3.js and sent to app.py, where it is used for an API call to retrieve the necessary data. This data is then returned in JSON format to JavaScript for renderi ...

Ensuring that the text input is perfectly lined up with the submit button

Is there a way to solve this discrepancy? Solution: https://jsfiddle.net/6q352ysx/59/ The elements are currently the same height, but not aligned properly. https://i.stack.imgur.com/ajVyJ.png Which alignment option should I use? Option 1: vertical-ali ...

What could be causing the blurriness in the image?

I'm having trouble displaying an image below my navigation bar. The image I'm trying to display is located at https://i.sstatic.net/8PUa3.png and has dimensions of 234 x 156 px. However, the image appears blurry and only a portion of it can be s ...

Ensuring the Line Breaks in CSS and JavaScript to Easily Modify the Style

Is there a way to determine when a line will break so I can apply different styles? The design team needs 3 buttons in a grid (3 columns) with specific sizes. They want buttons with content that breaks onto the next line to have a border-radius of 13px, w ...

Expanding <a> element to cover the entire <li> container

Take a look at this straightforward menu layout: <ul id="menu"> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> </ul> I'm looking to expand the <a> element so that it ...

The form refuses to submit using ajax, although it typically submits without any issues

Check out this code snippet: $('.saveCheck').on('click',function() { var form = $(this).parents('form'); form.submit(function (event) { $.ajax ({ t ...

Developing a PHP and JQuery Web application that allows the sharing of common files across multiple sub

Just made my first post here and I must say, this site is amazing! It has helped me numerous times without me even having to ask a question until now! I have developed a webapp using PHP / MySQL / JQuery where everything is loaded and posted using JQuery ...

Steps for splitting a numbered list and adding an image above each item:

I have a challenge I'm trying to tackle with my list: My goal is to create a long, numbered list that is divided into different sections I also want to include an image within each list item and have it display above the numbered title of the sectio ...

Using AngularJS directives in Markdown

I am currently working on creating a custom HTML directive using AngularJS that will allow me to display Markdown content in the browser. My goal is to have a <markdown> element with a src attribute that will dynamically load and render the specified ...

Tips on harnessing the power of AngularJS $scope

In need of assistance! I have a paragraph and a counter that I want to update whenever the user clicks on the paragraph, all using AngularJS. Below is the code snippet I've come up with: <!DOCTYPE html> <html> <head> <script src= ...

What is the most efficient way to send various props to multiple child components within a React parent component?

Currently, I am working on developing a color palette generator using React. However, I have encountered an issue where all child divs in the color palette receive the same color instead of different colors. Below is the code snippet: class ColorPalet ...

When the jquery.show() function is invoked, scrollbars are displayed on the screen

I am encountering an issue with a flydown menu that includes a scrollable div. The div is about 400 pixels in height, causing scrollbars to appear in the drop down menu. When I hover over it, I trigger the show method as follows: $("#flydown").show(); Al ...

Incorporate the selectpicker feature into a dynamic input field

I am currently utilizing Laravel for my web development. In my controller, I pass a list of questions to the view and display them as follows: @foreach($questions as $q) <div class="col-xs-12"> <input type="{{ $q["type"] }}" class="fo ...

Sturdy and adaptable in a container designed with a responsive width

Currently, I am developing a responsive app and I am facing the challenge of making some parts of the search bar responsive while keeping others fixed in width (like the search icon). I attempted to achieve this using the following code: .wrapper{ ...

Web Essentials is experiencing a problem with minified CSS

Today, while using Web Essentials 2013 for Update 3 with Visual Studio Express 2013 for Web, I encountered an issue with the minified CSS file. The website I am currently working on is built on a Twitter Bootstrap platform and utilizes two separate CSS fil ...

Is there a way to create an HTML popup that automatically opens a link and an image file side by side

Can a popup code be created to automatically open both a link and an image side by side? ...

Tips for changing the <title> in an AngularJS one-page application

I am working on a single-page AngularJS application. The index.html file is structured as follows: <html ng-app="myApp" ng-controller="MyCtrl as myctrl"> <head> <link rel="stylesheet" href="my-style-sheet.css"> <title>{{ ...