Scroll bar is missing when items exceed the visible portion of the page

I am currently working on a recipes app that displays a list of recipes with images in individual tiles down the right-hand side. However, I have encountered an issue where the browser scroll bar does not appear when the list extends beyond the visible area, causing the third recipe tile to go off-screen without any way to scroll down and view it.

Despite trying various suggested solutions, such as setting overflow to auto on the container, the problem still persists.

Below is the relevant code snippet:

h2 {
  font-size: 280%;
  font-family: 'Lobster', cursive;
  left: 160px;
  position: relative;
  top: 15px;
  color: rgb(90, 205, 250);
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

* {
  background-color: transparent;
  width: 265px;
}

img {
  border-radius: 12px;
  height: 100px !important;
  width: 261px;
  right: 3px;
  position: absolute;
  bottom: 76px;
}

.list-item {
  display: flex;
  top: 0px;
  position: relative;
  left: 88px;
  background-color: white;
  border-radius: 12px;
  margin-top: 15px;
  border: solid #a84605 1.5px;
  color: hsl(17, 89%, 40%);
  height: 180px;
}

.item-text {
  top: 75px;
  position: relative;
  color: rgb(100, 100, 100);
}

.recipe-container {
  height: auto;
  overflow: auto;
  width: auto;
}
<link href="https://fonts.googleapis.com/css?family=Lobster&display=swap" rel="stylesheet">

<h2>Recipes</h2>

<div class="recipe-container">
  <div *ngFor="let recipe of recipes" class="list-item">
    <a href="#" class="list-group-item clearfix" (click)="onRecipeSelected(recipe)">
      <img [src]="recipe.imagePath" alt="{{ recipe.name }}" class="img-responsive">
      <div class="pull-left">
        <h4 class="list-group-item-heading item-text">{{ recipe.name }}</h4>
        <p class="list-group-item-text item-text">{{ recipe.description }}</p>
      </div>
    </a>
  </div>
</div>

Answer №1

One possible solution could be avoiding using 'auto' as the height value in your .recipe-container class. Instead, consider setting a fixed height limit using either the 'vw' unit or '%'. This adjustment may help address the issue at hand.

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

Is it possible to nest components within one another in Angular?

It seems similar to this: <app-component1> <app-component2></app-component2> </app-component1> I couldn't locate any information about this in the Angular documentation. Whenever I try to use a component within another com ...

Searching function in material-table does not work properly with pipe symbol

Within my data table, I utilize the @pipe to display name instead of position in the position row... The name is sourced from a separate JSON file... <ng-container matColumnDef="position"> <mat-header-cell *matHeaderCellDef> No. </ma ...

Define a distinct routing parameter that can be accessed through the ActivatedRoute instance

While working on setting up a router in my application, I encountered the need to define a query parameter that must be retrievable through the ActivatedRoute for compatibility reasons. Recently, I had to create some new sub-routes that do not follow the s ...

How to conditionally apply a directive to the same tag in Angular 4

I am implementing angular 4 and have a directive in my template for validation purposes. However, I would like to first check if a specific condition is true before applying the directive. Currently, my code looks like this: <div *ngIf="groupCheck; els ...

How come the image height isn't working in a bootstrap column?

Why is the tomato picture taller than the others even though I specified the height and width? It must be something simple: <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/> <div class="conta ...

Sorting arrays in Typescript

Is there a way to alphabetically sort an array of objects in Typescript based on a specific field? The array I have currently looks like this - https://i.stack.imgur.com/fQ3PA.png I'm interested in sorting it alphabetically by the 'channel' ...

HTML block failing to implement Bootstrap styling

I am struggling to integrate Bootstrap into Drupal. I have used the 'row' class for the contact ID and added col-sm-12 for title and desc, but it is not working as expected. The width of the container seems off. Also, the accordion.js script work ...

Create an array that can contain a mix of nested arrays and objects

Working on my project using Angular and TypeScript includes defining an array that can contain arrays or objects. public arrangedFooterMenu: IMenuItemType[][] | IMenuItemType[] = []; typesOfData.forEach(type => { let filteredData: IMenuItemType | ...

How can I use flexbox to position this footer at the bottom of its parent container?

I'm not an experienced designer and it's been a while since I last worked with CSS. I'm diving into using flexbox layout for the first time and feeling a bit overwhelmed. Here is the existing HTML structure that I need to work with and cann ...

Is it recommended to continue using vendor prefixes for border-radius property?

When coding, I currently utilize the following: -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; After running tests, it seems that there was no noticeable difference in modern browsers (Chrome 33+, Opera 25+, Safari 8+). Internet ...

Spacing for Bootstrap Navbar List Items

I've searched through the CSS and I'm unable to identify what is causing the width between the top level links on my navbar. I need them to be slightly smaller so that when it adjusts for a screen below 900px, it doesn't convert into a 2-row ...

The issue of CSS percentages not functioning properly in Internet Explorer 9 while working seamlessly in all other browsers

Currently, I am creating a unique theme with inline CSS for my first website located at . I have conducted testing on various browsers such as Firefox, Opera, and Chrome, only to discover that most of the CSS is not displaying correctly in the latest vers ...

How to assign an enum value to a JSON object in an Angular application

I am currently dealing with a scenario where I have a constant requestBody object being defined. It contains various properties like clientId, orderingId, receivedSignatureFlag, saturdayDeliveryFlag, and so on. const requestBody: RequestBody = { clientId ...

When receiveMessage is triggered, the FCM push notification fails to refresh the view

After following this helpful tutorial on Push Notifications with Angular 6 + Firebase Cloud Messaging, everything is working perfectly. I am able to receive notifications when using another browser. To ensure that my notification list and the length of no ...

Expand a div without causing any displacement to surrounding elements

If you have 4 colored divs (red, yellow, green, blue), with 2 per row, and need to expand the second (yellow) without creating a gap under the red, check out this solution. The blue will be positioned underneath the expanded yellow. For a live example, vi ...

CSS styling not appearing on HTML button

I'm attempting to create a login page similar to Instagram using HTML and CSS. However, I'm having trouble styling the button to match Instagram's login page. The button <input type="submit" class="sub-btn"> The CS ...

Hey there, I have a header.css file!

My React project is experiencing issues with the CSS file. The first header in the CSS file works fine, but the second header and every other class created after it are not responsive. Only the 'header' class is properly linked to Header.css file ...

Strategies for Implementing Pagination in an Angular 2 HTML Table Without the Use of Third-Party Tools

I have an HTML table that displays basic details along with images. I am looking to implement pagination for this table in Angular 2. Are there any alternatives to using ng2-pagination? ...

Browse through all products with just one click using JQuery!

I am trying to achieve a feature where clicking a 'View all' button under the product sheets will display all the products in alphabetical order by adding clones at the bottom of the page to fill all available spaces. Can you assist me with this? ...