Is the content within the div not displaying fully?

I'm working on a one-page website using Bootstrap columns, but I've encountered an issue. When I shrink the screen, the content of a form that is positioned absolutely doesn't fully appear. How can I ensure that the second column adjusts its height to display all the content? I've tried using overflow: scroll and overflow: visible in the imageWrapper class, but it hasn't solved my problem. Here's the desired result I'm aiming for: result.

Here's the HTML and CSS code snippet:

.imageWrapper{
    height: 100%;
    width: 100%;
    position: relative;
    overflow: auto;
}

.formShape {
    position: absolute;
    height: 100%;
    top: 0;
    right: 0;
}

.form {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display:none;
    margin-bottom:80px;
    width:540px;
    height:650px;
    background:#fff;
    border-radius:5px;
    overflow:hidden;
    z-index:1;
}
<div class="container-fluid h-100">
    <div class="row no-gutters h-100">
        <div class="col-12 col-md-6 left">
            Content 1
        </div>
        <div class="col-12 col-md-6">
            <div class="imageWrapper">
                <img class="homePhoto" src="images/img1">
                <img class="formShape" src="images/img2">
                <div class="form" id="formContainer">
                    <form>
                    ...
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

Answer №1

After reviewing the layout, I have implemented the following changes:

  1. The image was added as a background image to the .imagewrapper class
  2. I removed the form shape div and used the form itself as the shape - if needed, a background image can be added to the form

Does this meet your requirements?

(I have temporarily added borders for clarity purposes but they can be easily removed)

.imageWrapper {
  border: 2px solid red;
  background: url('https://source.unsplash.com/random');
  height: 100vh;
  position: relative
}

.content {
  border: 2px solid blue;
}

.form {
  border: 2px solid green;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  z-index: 1;
  height: 90%;
  width: 90%;
  border-radius: 50px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid h-100">
  <div class="row no-gutters h-100">
    <div class="content col-12 col-md-6 left">
      Content 1
    </div>
    <div class="col-12 col-md-6">
      <div class="imageWrapper">
        <div class="form" id="formContainer">
          <form>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>

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

Choose the initial unordered list within a specific division through Jquery

In a div, there is a ul. Inside a li, there is another ul. The task is to select only the first ul inside the div using jQuery. The HTML markup: <div class="parent"> <div class="clearfix"> <div class="another-div"> <ul cl ...

Rendering a child component beyond the confines of its parent component in React.js: A Step-by-Step Guide

I am working with a table component that has sticky headers and dropdowns, ellipsis menus, and other complex components within the table body rows. Each row of the table contains nested table body rows, and the parent rows stick to their child rows. Howeve ...

Navigating through a multistep form in AngularJS using UI Router and arrow keys for seamless movement

Is there a way to navigate to the next or previous form step using arrow keys in AngularJS UI Router? The code provided below is currently allowing navigation with previous and next buttons. .config(function($stateProvider, $urlRouterProvider) { $stat ...

Identify the browser dimensions and implement CSS styling for all screen resolutions

I am currently facing an issue with a function that I have created to apply CSS changes to a menu based on browser resizing and different resolutions. The problem lies in the fact that my function does not seem to be correctly interpreted by the browser. W ...

Retrieve the string data from a .txt document

I am facing an issue with my script that retrieves a value from a .txt file. It works perfectly fine when the value is a number, but when trying to fetch text from another .txt file, I encounter the "NaN" error indicating it's not a number. How can I ...

Display different images based on user selection in vue.js

I am new to working with vue.js and I'm facing a challenge. My goal is to display images of NBA players based on the selected criteria using vue.js. For instance, if the Dunk contest champion is chosen, only images of Kobe and Jordan should be display ...

Spin symbol when hovering over a hyperlink

I included a link and an icon afterwards. https://i.sstatic.net/MbrSH.png <a class="link--primary" href="#">LINK<svg class="icon icon-arrow-right"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow-right"></use ...

The width property is not being passed down to the table

I'm experiencing difficulties with the scaling of my body content. When the page is initially opened, it scales to 100%. However, when I resize the screen to make it wider, the content gets bigger but when I try to make it smaller again, it remains a ...

Unable to adjust the size of a DIV with a button click in Vue3

I am having trouble resizing a DIV block in Vue3. Whenever I click the button, I receive an error message saying "Cannot read properties of undefined (reading 'style')". I know there is an issue with the JS part of the code, but I'm not sure ...

PHP code to display "ed elements that do not adjust height"

A php script is being utilized to scan a directory and populate a gallery with all the images. Within the <div id="content"> tag, the function <?php create_gallery("path"); ?> loads all the images. The issue arises when the height of the <d ...

Unchanging Dive Field

I'm having trouble understanding why this field isn't updating with the correct number. It seems that any value less than 1 is being rounded in the alert() function. I believe all numbers are simply getting rounded down, but I'm unsure of an ...

What steps should be followed in order to create an animation that makes this shape move in

My goal is to create a shape that symbolizes a garage door opening and closing. With the right guidance and design, I will be able to adjust the CSS properties such as width and height accordingly. I appreciate your help! ...

Ensure that the remaining space on the page is filled by utilizing 2 divs

I am currently in the process of developing a website that needs to be responsive on all pages. The layout consists of 5 divs positioned horizontally. The three middle divs have fixed sizes - 200px, 400px, and 200px respectively. However, I am facing a cha ...

Achieving equal heights for div boxes while aligning list items inside

I have 8 green boxes on my site, each containing an image and either 3 or 4 list items with text only. The issue I'm facing is that the boxes are not of equal height due to two reasons: (1) One box may have an extra list item pushing the rest down, or ...

Is there a way to modify the commandlink image when the mouse hovers over it in PrimeFaces?

After implementing this code snippet, my commandlink seemed to vanish into thin air. Upon inspecting it with firebug, I discovered that it was present but had a size of 0 x 0 px. .myNewButton { width: 50px !important; height: 50px !important; background ...

Bootstrap grid with 4 columns featuring text of varying lengths and styles

I currently have a layout on my webpage that consists of four columns. Each column includes a logo, an <h2> tag, and a <p> tag. My issue is with aligning the paragraphs horizontally so they match consistently. Whenever the text in the <h2&g ...

"Unlocking the Power of CK Editor for Maximizing Value and Effectively Managing

I have a form with a field titled Description. I am using CKEditor to pass the value entered into this field and store it in my database. Can someone assist me with this? Below is the code snippet: <div id="descriptionMore" style="margin-bottom:20px; ...

Tips on allowing a rectangle to be draggable using HTML5

I have been experimenting with resizable and draggable rectangles in HTML5. I've managed to create resizable rectangles, but I am having trouble getting them to drag using mouse events. You can view my JSFiddle code at the following link: here. / ...

Get the CSS3 Challenge: Achieving a Gradient Background Pattern without the Need for Multiple Divs!

Seeking advice from experienced CSS designers on creating a similar background pattern without relying on div tags like in this example: http://codepen.io/juanbrujo/pen/IrAfF ...

What is the method for triggering a function from an input tag without actually typing into it?

Currently, I am utilizing the angular2 color picker which updates the value of the input element when a color is chosen instead of typed. My task now is to trigger a function once the value of that input tag changes. Unfortunately, keyup and keydown method ...