Column spilling over with cards

Having a card with a form in it, I wanted to implement a y-scroll bar to control the visibility of the form on the page. However, it seems that the columns are extending beyond the boundaries of the card.

.card {
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
  transition: 0.3s;
  padding: 10px;
  background-color: white;
  border-radius: 1%;
  width: 115%;
  margin-left: -9%;
  max-height: 42%;    
}
    
.column {
  float: left;
  background-color: white;
  margin-left: -15%;
  margin-right: 175%;
  margin-top: -5%;
}
    
.column2 {
  float: left;
  background-color: white;
  margin-left: -200%;
  margin-right: -1%;
  margin-top: -8%;
  width: 100%;
  border-left: 1px solid #E1E0E5    
}
    
/* Clear floats after the columns */
.row:after {
  content: "";
  display: table;
  clear: both;
}
    
.scroll-box {
  overflow-y: scroll;
  height: 40%;
  padding: 1rem;
}
<div class="card">
  <div class="row">
    <div class="column"></div>
    <div class="column2">
      <div class="scroll-box">
        <form #f="ngForm" novalidate>
          <!-- steps of the form -->
          <button type="submit" (click)="save(f.value, f.valid)">Submit</button>
      </form>
      </div>
    </div>
  </div>
</div>

How can I make sure that the columns stay within the card's height and do not overflow out of it?

Currently, the display looks like this:

https://i.sstatic.net/mwaEt.png

Answer №1

To ensure the correct heights of the columns, consider utilizing flexbox:

.card {
  display: flex;
}

To prevent overflow, you can use the overflow property or the overflow-y property, for instance:

.column2 {
  overflow-y: scroll;
}

Alternatively, you might want to try:

.card {
  overflow-y: hidden;
}

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

Position the select tag adjacent to the textbox

Looking for assistance on how to arrange the <select> tag beside the "Desired Email Address" field within my email registration form. I believe a modification to the CSS code is necessary. Below you will find the HTML and CSS (snippet) related to th ...

It appears that the input variables in Angular (5) are experiencing some issues

After upgrading my Angular project from version 4 to 5, I've noticed some unexpected changes in the behavior of my components. In my application, there is a ParentComponent and a ChildComponent. The ChildComponent receives an InputObject from its par ...

The dropdown height feature is experiencing issues in the Chrome browser

3 radio buttons and a single select box are displayed on the page. When clicking on the first radio button, the select box should show contents related to the first radio button. However, when selecting the second or third radio buttons, the select box hei ...

Ways to vertically center an absolutely positioned element

In the code snippet below, there is a .square-container that is absolutely positioned and contains a square. The goal is to vertically center the .square-container within its parent div. .container { position: relative; background-color: blue; } ...

Chrome failing to recalculate the width of an element as required

When attempting to size an element's width based on its height, I discovered what seemed like a clever solution using the transparent img trick: http://jsfiddle.net/6yc8a2yj/ The pink div displays correctly at a 1:2 ratio, but it fails to resize whe ...

Unable to transform the singular JSON object received from the server into the necessary format in order to analyze the data

Forgive me if my questions seem simple, as I am new to working with Angular. I'm having trouble understanding how to handle a JSON object received from the server and convert it into a custom datatype to use for rendering HTML using ngFor. I've ...

Is there a way to prevent EasyTabs from automatically selecting the second tab?

I'm facing an issue with setting the default tab using easytabs. Currently, the second option is automatically selected as the default tab. Previously, I had successfully set the first tab (statistics) as the active tab but lost the file. Now, I am s ...

Preventing Click Events from Firing During Drag in JavaScript

I have implemented a code for dragging containers left or right, which is functioning properly. Users can also click on the "thumb". However, I am facing an issue where a click event occurs even after dragging. I want to ensure that only either drag or cli ...

Executing the SQL query more than once is not permitted

I seem to be facing a challenge in executing SQL queries multiple times. In the given code snippet, the first SQL query 【SELECT h.title, h.place, h.introduction ~】works fine. However, the second one 【SELECT name ~】fails to execute. If I comment ...

What is the process for altering the background color of a modal?

I'm trying to figure out how to change the background color of my modal once it's displayed, similar to this example: https://i.stack.imgur.com/fOUDZ.png. I want the background color to cover the entire page and not just the modal itself. When I ...

Delivering styled coldfusion outcomes utilising css and jquery

After using jquery to retrieve some data, I've noticed that the results are displayed correctly but the CSS is not being applied. Is there a way to style the results with CSS? function doSearch() { //Making an AJAX call to the server $.ajax({ / ...

Uploading Images to Imgur with Angular 4

As a newcomer to TypeScript, I am faced with the challenge of uploading an image to the Imgur API using Angular. Currently, my approach involves retrieving the file from a file picker using the following code: let eventObj: MSInputMethodContext = <MSIn ...

Prevent table headers from scrolling in Bootstrap Vue by following these steps

Just starting out with bootstrap vue and I've been using version 1.4 for my application. I've utilized b-table for displaying my data, but I'm encountering a problem where the table headers also scroll along with the content. I'd like t ...

Steps for embedding the code into your website

I'm facing an issue with integrating a .jsx file into my website. I tried testing it on a single-page demo site, but nothing is showing up. Can someone guide me through the steps to successfully integrate it onto my site? I've also attached the . ...

Shifting successive elements in an array alternates

I have been working on a pick list component and have come up with the following layout https://i.stack.imgur.com/TnHAp.gif Whenever I try to move consecutive items, it keeps toggling between those two Here's a snippet of my code: moveDown(){ ...

Centering bootstrap columns in a WordPress template

I am facing an issue with aligning columns in a bootstrap section within a Wordpress template that I am working on. The problem is that the columns on the second line of the row are not centered. Currently, the layout displays 4 columns in the top row and ...

The jQuery.addClass() function seems to be malfunctioning

I'm encountering an issue with the addClass() method. For some reason, it's not functioning properly in this scenario: https://jsfiddle.net/0g1Lvk2j/20/ If you scroll to the end and close the last box by clicking on the orange box, the orange b ...

Trouble displaying JSON markers on Ionic Google Maps

Looking for assistance related to this issue? Check out Ionic Google Maps Markers from JSON In my Ionic App with Google Maps integration, I'm facing an issue where although the map displays correctly, the pin markers are not showing up. It seems like ...

I am experiencing difficulty with aligning my input boxes to the center in my React-Native

Just a heads up, this is my first time diving into the world of React Native, so bear with me as I try to figure things out. Please be kind if my question seems silly... Here's a snapshot of what I currently have: https://i.stack.imgur.com/VWGFm.png ...

Iterate endlessly over CSS styles in Angular 4

I'm looking to create a website background 'screensaver' by looping through an array of background URLs with a delay between switches. Currently, I have the array stored in my .ts file and I am using the NgFor directive in my HTML. However, ...