The Div element is not expanding to fit the content within it

I am currently incorporating a third-party Angular library for carousel functionality in my application, along with utilizing Angular-Material for layout. However, I have encountered an issue where my <ul></ul> element does not expand to accommodate the content when using this library's directives:

<div layout="row" layout-align="center center" layout-padding style="overflow-x: hidden;
  overflow-y: hidden;">
    <div flex-sm="65" flex="40">
        <ul rn-carousel rn-carousel-transition="hexagon" rn-carousel-buffered
            class="ul-carousel">
            <li ng-repeat="card in cards">
                <md-card>
                    <img  imageonload="setImageLoading(imageLoading)" current-slide="carouselIndex"
                          ng-src="{{card.imageCoverRep.url}}"
                          ng-click="goCardDetails(card)">
                </md-card>
            </li>
        </ul>
    </div>
</div>

Below is the CSS for the carousel component:

input[type=range] {
  width:300px;
}

ul[rn-carousel] {
  overflow:hidden;
  padding:0;
  white-space: nowrap;
  position: relative;
  perspective:1000px;
  -ms-touch-action: pan-y;
  touch-action: pan-y;
  > li {
    color:black;
    backface-visibility: hidden;
    overflow: visible;
    vertical-align: top;
    position:absolute;
    left:0;
    right:0;
    white-space: normal;
    padding:0;
    margin:0;
    list-style-type:none;
    width:100%;
    height:100%;
    display:inline-block;
  }
}

/* prevent flickering when moving buffer */
ul[rn-carousel-buffered] > li {
  display:none;
}

ul[rn-carousel-transition="hexagon"] {
  overflow:visible;
}

/* indicators */
div.rn-carousel-indicator span {
  cursor:pointer;
  color: #666;
  &.active {
    color: white
  }
}

/* prev/next controls */
.rn-carousel-control {
  transition: opacity 0.2s ease-out;
  font-size: 2rem;
  position: absolute;
  top: 40%;
  opacity: 0.75;
  cursor: pointer;
  &:hover {
    opacity: 1;
  }

  &.rn-carousel-control-prev {
    left: 0.5em;
    &:before {
      content: "<";
    }
  }

  &.rn-carousel-control-next {
    right: 0.5em;
    &:before {
      content: ">";
    }
  }
}

Answer №1

From my perspective, it appears that you have utilized "position: absolute" for the >li element. I recommend removing this and instead implementing the float property.

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

The TD border is slicing through the div and is placed on the table in IE standards, causing it

Below is the HTML code where the div is being cut by the table border when the page is in standards mode. Interestingly, if I remove the <!DOCTYPE html>, then it works fine as expected. The issue of the outside div not behaving properly on the table ...

The div is not showing the image as expected

Having some trouble creating a slideshow within my angular application. Struggling to get the images to display in the html code. To tackle this, I decided to create a separate component specifically for the slideshow (carousel.component). In the main app ...

Karma Jasmine Angular is not recognized

I've been diving into the world of testing with Angular and Karma, trying to test my code written in AngularJS and Nodejs. Following Noesavy's tutorials on YouTube, I managed to set up Karma and Jasmine successfully using his examples. However, w ...

Top Bootstrap dropdown menu overlaid with Leaflet zoom buttons

I'm encountering an issue depicted in the screenshot below. Is this related to bootstrap or leaflet? How can I adjust the position/style of the dropdown menu so that it appears above all other elements? https://i.sstatic.net/cQhN5.png ...

Unlocking the potential: Extracting data from a PHP function using AngularJS

I understand the concept of ajax, but I am curious about retrieving data from a specific PHP function without creating multiple pages. Is it possible to have one page handle all the functions? AngularJs: var app = angular.module("myapp",[]); app.controll ...

How to Use ng-controller in AngularJS to Submit a Form with PHP

Hey there! I'm diving into AngularJS and PHP for the first time. My current project involves creating a Contact Form using AngularJs and PHP. The form is pretty straightforward, requiring users to input their First Name, Last Name, Email, and Message. ...

Exploring the Power of Pseudo-Elements within Polymer.js

I'm currently exploring the world of Polymer.js and I've encountered an issue with creating a pseudo-element that's been puzzling me. This is what I attempted: In my primary document: <style type="text/css"> #host::x-a-cool-test { ...

ng-Click isn't triggering despite being within the same scope

I couldn't find an answer to my question by searching through the forum. My goal is to populate the input field with the geolocated address after clicking a button, but for some reason the ng-Click="locate()" function is not working. Here is a snippet ...

What could be causing my Angular state to fail to load properly?

When my app starts, the following code is executed: $urlRouterProvider.otherwise('/loading'); This leads to the control being passed to my loadCtrl. Inside this controller, I have the following code snippet: Service.getRoleDetails(config.USER_ ...

What is the most compatible JavaScript framework for openlayers?

I'm seeking guidance on selecting a front-end framework (e.g. React, Vue, Angular) that is compatible with OpenLayers for my upcoming implementation. Could you please recommend the most suitable front-end framework to work seamlessly with OpenLayers? ...

Is there a way to not limit the height of parent elements when using the Bootstrap 4.6 grid system or Flexbox

I'm struggling to make Bootstrap/Flexbox work smoothly within a height restriction. In my design, I have a <main> element with a set height. In the application itself, this height is calculated so that the footer aligns perfectly at the bottom ...

The margins within the div of the new tab are not applying as expected

Greetings! Currently, I am in the process of generating a dynamic form within a new tab using JavaScript. For some reason, the margin effects on the div element are not being applied correctly. Despite my attempts to set the margins using both classes and ...

How can I shift the position further to the left in the navbar-toggler of Bootstrap?

I am looking to adjust the positioning of the navbar-toggler-icon and menus on my website. Despite trying to make changes in the CSS, only the icon image shifts while the menus remain unchanged. Can anyone provide assistance? Thank you. Visit this link fo ...

Utilize the `addEventListener` and `removeEventListener` functions on the menu to

Why is my mobile menu not functioning correctly? The submenu should open on the first click and redirect to the parent URL on the second click, which works fine. However, when the window width increases to 768px or more, the submenu should appear on hover ...

The issue of AngularJS directives not populating correctly with their associated templates

I'm encountering some challenges with directives and their scope. I've developed a directive to fetch all the members of a site and display them within a div, here's the code snippet: EngagementApp.directive('siteMembers', [' ...

The checkbox confirmation button appears to be absent in the ngx mat date time picker

I encountered a styling issue with the ngx mat datetime picker in my Angular 15 project. You can find the package here. To resolve the issue, I included @import "https://fonts.googleapis.com/icon?family=Material+Icons"; in my styles.scss file, and that re ...

Arrange two divisions vertically in the footer

Despite being a common question, I am facing difficulties with Bootstrap 4, which may be due to some conflicts. I am trying to create two divs placed one above the other, fixed to the bottom, with text centered in both. Here is the code snippet: ...

Changing the Size of the Google Map Pin

I am looking for a way to reduce the size of my customized Google map pin on the Google Maps API. My image is currently 135px (w) x 185px (h), but I want to make it smaller, like 26px (w) x 35px (h) so it fits better on the map. Is there a way to achieve t ...

Utilizing Angular 6 to create a navigation list with expanding panels using mat-nav-list and

Currently, I am working on creating a mat-nav-list with mat-expansion-panels as list items. However, I have encountered some issues with the alignment and functionality of the expansion panels within the list. It seems that the mat-nav-list is not handling ...

Tips for positioning two divs in the center of a webpage, both horizontally and vertically, while also including a header and

Currently, I am in the process of creating a new web page with Bootstrap 4. This page consists of four main elements - a header, a footer, and two content boxes contained within divs. While I have successfully utilized default bootstrap classes to ensure t ...