Automatically adjusting the height of a Bootstrap carousel as the token-input list grows in size

I am working on a carousel that functions as a form. One of the carousel items contains a multi-select box. How can I automatically increase the height of only that specific carousel item as the height of the multi-select box increases?

The first image shows how the carousel currently looks. The second image depicts how I would like it to appear.

Any insights or suggestions would be greatly appreciated. I am unable to refresh the carousel as it will cause my form inputs to be unset.

https://i.sstatic.net/3oqEU.png

<div class="row no-gutters" id="mob-carousel-row" [style.height.px]="mobileCarouselRowHeight">
        <div class="col-1 col-sm-1">
            <a href="#carouselExampleIndicators" role="button" data-slide="prev">
            <i class="fa fa-angle-left mobile-form-nav" ></i>
            </a>
        </div>
        <div class="col-10">
            <div 
                #plMobileCarouselForm 
                id="carouselExampleIndicators"
                class="carousel slide"
                data-ride="carousel"
                data-interval="false">

                <div class="carousel-inner" role="listbox" id="mob-carousel">

                    <div class="carousel-item active">
                        <div class="form-group md-form mob inputbox">
                            <!-- first input box item  -->
                        </div>
                    </div>
                    <div class="carousel-item active">
                        <div class="form-group md-form mob muti-select">
                            <!-- multi-select box item needs auto height adjustment -->
                        </div>
                    </div>
                    <div class="carousel-item active">
                        <div class="form-group md-form mob inputbox">
                            <!-- first input box item  -->
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-1 col-sm-1">
            <a href="#carouselExampleIndicators" role="button" data-slide="next">
            <i class="fa fa-angle-right mobile-form-nav" ></i>
            </a>
        </div>
</div>

Answer №1

I wanted to leave a comment, but unfortunately I am not able to do so at the moment.

Without seeing your CSS code, it is hard to provide an accurate solution.

One possible approach is to set the height of the container that holds the input forms or select boxes to auto. This will ensure that it adjusts itself dynamically as more options are added.

.carousel-item active {
  height: auto;
}

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

Adjusting the gaps between each item in a list

Currently, I am working on developing a minimalist single-page website. However, I am facing challenges with spacing in the navbar section (as demonstrated below). When using an unordered list, everything looks good until the list overlaps with the centra ...

Having trouble grasping the display property combination in Bootstrap4

Incorporating Bootstrap4 into my web application, I am faced with the task of displaying a menu exclusively on the large screen size setting (lg). The guidelines are straightforward: utilize a class to conceal an element across all screen sizes: .d-none ...

Align the radio buttons vertically

My goal is to align all my buttons vertically, similar to the first question. However, I'm struggling to get the second question to align correctly. Despite trying different methods like using the vertical-align: middle property, nothing seems to be w ...

Moving a popup div along with a marker in Leaflet can be achieved by using the set

After creating a map using leaflet and adding markers to different locations, I implemented code that displays a popup div with a message when a marker is clicked. Here is the code snippet: markers.on("click", function(d) { div.html("This is Some info ...

My JavaScript code runs perfectly fine on JSFiddle, but for some reason, it's not functioning correctly on

I need a solution where a new button is generated every time the post button is clicked, and each of these buttons should have its own counter. This works successfully in JSFiddle, but unfortunately doesn't work when I try to implement it elsewhere. ...

Having trouble with adding Jquery UI CSS to my project even after bundling

I have implemented jQuery UI in my small project, but the CSS styles are not being applied. The following bundle includes the necessary CSS files: bundles.Add(new StyleBundle("~/Content/themes/base/css").Include( "~/Content/themes/base/jque ...

The contact form in Laravel 5.7 seems to be malfunctioning as it is unresponsive and not displaying any errors

Here is the contact form along with the form action: <form action="{{ route('contact.send')}}" method="post" class="contactForm"> <div id="sendmessage">Your message has been sent. Thank you!</div> &l ...

Element in list displaying a distinct alignment from the rest

I currently have a navigation bar based on a list, which looks something like this: https://i.stack.imgur.com/e1Dmb.png My concern is how to position the "Logout" item on the right side of the screen. I've tried adding clear list items but that seem ...

Controlling the scroll behavior of div elements with the CSS overflow-y property

This is the current setup I have: <div> <div> </div> <div> </div> <div> </div> </div> The inner divs are styled with this CSS: float: left; margin-right: 40px; width: 100px; While ...

Ending the Overlay

I am using an overlay: <div id="overlayer" class="overlayer"> <div id="board" class="board"></div> </div> Here are the CSS properties I have applied to it: #overlayer { position:fixed; display:none; top:0; left:0; width:100%; hei ...

Background and checked styles for radio buttons

Thank you in advance for any assistance you can provide. I am looking to create a unique radio button design. When the radio button is not checked, I want it to display as a simple white circle. However, once it is checked, I would like it to appear eithe ...

What is the best way to make the children of a parent div focusable without including the grandchildren divs in the focus?

I want to ensure that only the children of the main div are able to receive focus, not the grandchildren. Here is an example: <div class="parent" > <div class="child1" > <!-- should be focused--> <div class="g ...

Is it possible to adjust the positioning of this navigation style?

Discover a unique collection of navigation styles by following this link: http://tympanus.net/Development/ArrowNavigationStyles/ Be sure to explore the final style "Fill Path" at the end of the page. I'm interested in adjusting the position of the ...

How can I fix the issue where Sx is not converting the styles to CSS format for the fill property exclusively?

The primary-main is supposed to change color to something like #abcdefg, but it seems to be stuck displaying primary-main as is. I am working with angular MUI + React https://i.sstatic.net/x07aI.png https://i.sstatic.net/8yuU3.png ...

Are "Color Scheme" and "Color Palette" distinct from each other?

What is the difference between a color scheme and a color palette? In one of my projects, which is a web template, there are options for customers to customize. However, I find myself confused with the naming conventions for two color-related options. Op ...

Customizing listview appearance in asp.net with css and enhancing with javascript

When I print, the css class is not being used although it appears when using the program <script type="text/javascript"> function printDiv() { var divToPrint = document.getElementById('DivIdToPrint'); ...

Slide containing Ionic list views

In my Ionic app, I am using ion-slide-box with 3 slides. Each slide contains an ion-list (table view) with varying numbers of items. The issue is that when scrolling through the shorter list items, it shows empty content due to the taller sibling list taki ...

Creating uniform height for Definition Terms (DT) and Definition Descriptions (

Looking to creatively style a description list <dl> in a way that showcases two columns, even when there are multiple <dd>s following the <dt>. The challenge lies in wanting this design to be dynamic without resorting to floating the < ...

Retrieve the value of a CSS class property regardless of whether it is actively being utilized

I am facing a dilemma where I need to determine the value of the 'width' property for a css class named 'foo' (example: ".foo { width:200px}" ). However, there may not be an element with this class in the dom yet. My goal is to retrie ...

What is the method to modify the color of the final letter within an element?

Is it possible to make the last letter of a word appear red using CSS? <asp:Label ID="QuestionText" runat="server" CssClass="asterisk"></asp:Label> .asterisk:after { color: Red; content: " *"; } The challenge arises from the fact tha ...