Why is it that the form does not fully appear when the screen is being resized with absolute display?

Utilizing bootstrap columns, I have a form that is set to display: absolute. However, when the screen size is reduced, the form does not appear completely as seen in this image.

How can I ensure that the form appears entirely as shown in the desired result?

The following is the HTML and CSS code for the form class:

.form {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display:block;
    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">
            <div class="wrapper">
                ...
            </div>
        </div>
        <div class="col-12 col-md-6 px-0">
            <div class="imageWrapper">
                <img class="homePhoto" src="images/photo-home">
                <img class="formShape" src="images/forme_blue_half.png">
                <div class="form" id="form">
                    <h2>LET'S TALK</h2>
                    <form action="" method="post">
                        <input class="input field" type="text" id="name" name="user_name" placeholder="LAST NAME&#42;" required>
                        <br/>
                        <input class="input field" type="text" id="firstName" name="user_firstName" placeholder="FIRST NAME&#42;" required>
                        <br/>
                        <input class="input field" type="email" id="email" name="user_mail" placeholder="E-MAIL&#42;" required>
                        <br/>
                        <input class="input field" type="text" id="organization" name="user_organizationName" placeholder="ORGANIZATION NAME">
                        <br/>
                        <textarea class="field fieldTextArea" id="msg" name="user_message" placeholder="PLEASE TELL US ABOUT YOUR NEEDS&#42;" required></textarea>
                        <br/>
                        <div class="checkboxContainer">
                            <input type="checkbox" id="receiveEmails" name="receiveEmails" checked disabled>
                            <label class="checkbox" for="receiveEmails">I would like to receive information e-mails</label>
                        </div>
                        <br/>
                        <input class="button submitButton" type="submit" value="Submit">
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

Answer №1

One suggestion is to adjust the width of your form by changing the value from pixels to a percentage.

    .form {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display:block;
        margin-bottom:80px;
        width:100%;
        height:650px;
        background:#fff;
        border-radius:5px;
        overflow:hidden;
        z-index:1;
    }

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 create a HTML 5 tile with a contemporary Metro-style UI?

I am curious to know if it is possible to replicate the tile system found in the modern UI of Windows 8 on an HTML page. I have already created a demo based on a website. You can view it here. Below is the code snippet: <div class="tile pos1-1 w1h1 te ...

What could be causing the child element in CSS to be larger than its parent element when sorting?

I am working with a UL that contains multiple LI's. Within each li, there is a table. Using mootools, I have made my li elements draggable/sortable. However, I only want a small portion of the li element (and its child table) to be draggable. I atte ...

Can you explain the functionality of $on.constructor in AngularJS?

Recently, I attempted an XSS challenge on the PortSwigger labs website. You can find the challenge here. This is my solution to the XSS challenge: {{$on.constructor('alert(1)')()}} However, since I have no prior experience with AngularJS, I&apo ...

Activate the console.log functionality if it has been previously turned off

When working on a project, I noticed that console.log is disabled. Although Firefox alerts me about this, I don't have the time to locate where in the code it's disabled. Is there a method for overriding the disabling of console.log specifically ...

What is the best approach to reverse the selection of <li> elements by utilizing :not() and :contains

I am looking to implement a live search feature using jQuery. Below is the code snippet I have written: $("#searchInput").on("keyup", function () { var searchTerm = $("#searchInput").val(); $('li:contains("' + searchTerm + ' ...

Align Divs Horizontally to Center

I'm trying to find a way to horizontally center multiple DIVs in a straight line. Here's how my code currently looks: HTML: <div id="circle"> <div id="circle1"></div> <div id="circle2"></div> </div> CSS ...

What steps can I take to ensure that my website is properly displayed and that my navbar appears beneath the logo on smaller screens? It is currently functioning well on desktops

Currently exploring web development for a new restaurant site, I've encountered an issue with the display on smaller screens. The page doesn't show full width and the navbar disappears entirely. How can I adjust the layout to ensure it looks good ...

What's the reason behind the presence of the a tag before the button in this

While working with Bootstrap 4, I noticed that the a tag is being displayed before the button when using the following code. Can anyone explain why? <button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#navbar ...

What is the best way to wrap text and move the lines up without affecting the bottom margin?

When the text length increases in the first image, it shifts upwards similar to what you see in this image. How can I achieve this effect? The use of "word-wrap" causes the line to break and move to the next line, which is not what I want. In the code sn ...

Pressing the enter key should trigger jQuery to submit the form

Whenever a user submits a comment on my site by pressing enter, it works as intended. However, if the user wants to create a new line without submitting the comment (e.g., by pressing shift+enter), how can this be achieved? This is the current code I have ...

Using jQuery to show array elements with unique formatting or separator

Using the jQuery map/get function, I am able to retrieve an array of values from multiple checked checkboxes: $('input[type=checkbox]:checked').map(function(_, el) { return $(el).val(); }).get(); After executing this code, I will get an arr ...

Performing an asynchronous AJAX request to a PHP script to compute the total sum and retrieve

I have created an HTML table and utilized AJAX to send a POST request with two arrays. The first array is named rowValues and contains three arrays, one for each row. The second array is called columnValues and also has three arrays, one for each column. ...

What could be causing my <UL> to not properly expand around the <LI> items inside of it?

I am currently working with WordPress and have created a menu using a list structure. Here is an example of how it looks: <ul> <li>Home</li> <li>About</li> <li>ParentItem <ul> <--- The heig ...

Arrange divs in a stack when one becomes too full

Struggling to find a pure CSS solution for this issue, so seeking advice. Imagine three divs aligned horizontally next to each other. If one div overflows onto the next line, I want them to switch to a vertical stack layout. How can this be achieved? I h ...

Modify the color of the sidebar text in bootstrap from text-light to text-dark upon clicking with jQuery

Looking for assistance in integrating jQuery code to remove the "text-light" class when the side menu is open or when the navbar-toggler button is clicked. $(document).ready(function() { $(".sidebarNavigation .navbar-collapse").hide().clone().appendTo ...

Guide on updating directory images by uploading a new one directly onto the site

As someone who is new to HTML, I have a question about updating images on my website through an "admin" page. Currently, I have two websites set up - the main site displays an image from the "images" folder, and the second site serves as an admin page. M ...

CSS: Various elements share a common transition effect, yet they do not fade in or out in a uniform manner

In the process of creating a dropdown menu that transitions with a fade in and fade out effect upon hover, I noticed an interesting anomaly. While all elements share the same transition behavior, there is a noticeable difference in appearance when hovering ...

Implementing dynamic styles for a checked mat-button-toggle in Angular 6

How can I customize my button-toggle when it is checked? The current code I have doesn't seem to be working... This is the code snippet: <mat-button-toggle-group #mytoggle (change)="selectoption($event)" value="{{num}}"> <mat-bu ...

What is the best way to create an interactive menu icon that includes dropdown options using MUI menu features?

i am looking to create a component similar to this https://i.sstatic.net/fwIB0.png currently, I am utilizing a material UI pop menu in my project below is the JSX code snippet <div className="navMenu" style={{ position: "relative" ...

PHP form submission upon conditions being satisfied

I am not utilizing Javascript as it is disabled in my current environment. Here is the code that I would like you to review. I am attempting to use PHP to replicate the functionality of Javascript or jQuery's simple : document.form2.submit() <div ...