As new content is being appended at the bottom of the HTML page, the existing content at the top will gradually vanish

Check out this HTML form that I have put together.

@import url('https://fonts.googleapis.com/css?family=Roboto');

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  font-family: 'Roboto', sans-serif;
}

body{
  background-image: url('bg.jpg');
...

I've noticed that when the status results from sending messages show up at the bottom of the page, the top portion disappears and you can't scroll back up. To see an example, I've created a JSFiddle here.

Although I'm not a UI expert, could someone please point out where the issue lies? See image https://i.sstatic.net/F0Umr.jpg

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Responsive Contact us form Using HTML and CSS</title>
    <link rel="stylesheet" href="styles.css">

...
                        </div>
            </div>
        </form>

...

Answer №1

The wrapper div is set as absolute, causing the content to be hidden due to its height being less than the parent element. To fix this issue, you can either change the .wrapper to relative instead of absolute or add a scroll for the wrapper.

Feel free to try out the code below:

.wrapper {
    position: relative;
    top: auto;
    left: auto;
    transform: initial;
}

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

Tips for aligning items at both ends using flexbox

I have a td containing two div elements, and my goal is to align these div at opposite ends. <td class="lefts"> <div> <h4>VOUCHER </h4> <h4>DATE TIME </h4> <h4>SALESMAN</h4> ...

Can you explain the significance of xpath=1 in an HTML document?

I am confused about a line in my design code that reads xpath="1". Can someone explain what this means in the context of the following code snippet? <select class="search-category" id="ddlTemp" name="Template" x ...

Using Jquery to select an HTML <option> element

How can I correctly select any of these options using Jquery? <select> <option id="x" >A</option> <option>B</option> <option>C</option> <option>D</option> </select> <div id="one">& ...

The CSS float is positioned beneath the Bootstrap navigation bar

Having an issue with the menu bars in my Rails 4 app. Specifically, I'm struggling with two divs overlapping. The goal is to align the "Register" and "Log In" blocks with the left-hand side menu while floating right. It should not float slightly belo ...

The best approach to incorporating interactive animation in next.js

My vision is to develop a character creation application using next js. The app should empower users to customize the character using sliders and gender selection buttons. The ultimate goal is to have a 2D animated version of the character that dynamicall ...

Looking to create an anchor tag that navigates to a specific ID on the page while accommodating a fixed header placement

In my application, the homepage's carousel displays multiple images with dynamically generated anchor tags that link to different routes. When clicking on the anchor tag, the page scrolls to the linked image but is obstructed by a fixed header. I want ...

Tips for organizing AJAX code to show images and videos in HTML with a switch case approach

I have 2 tables, one for images and one for videos. Within my HTML code, I have three buttons: slide_image, video, and single_image. Using iframes, I am able to load images and videos on the same page. When I click on the slide_image button, it displays im ...

Unable to display image between two inline-table divs while using Bootstrap

I'm currently developing a website for trading in-game items, but that's not important right now. The code snippet I am working with is: <div class="trade"> <h6><strong>RaiZeN</strong> wants to trade: (5 minutes ...

Solutions for altering the appearance of a combobox using CSS

Currently, I am experimenting with javafx 2 and trying to modify the background color of the menu/list through CSS. Despite attempting the code snippet below, nothing seems to be working as expected. Do you have any suggestions or insights on how to achi ...

The jQuery dropdown menu smoothly expands to reveal all hidden submenu options

I'm currently encountering an issue with jQuery. I am trying to create a responsive drop-down menu with sub-menus. The behavior I want is that if the window width is less than 700px, the submenus will trigger onClick. And if the window is wider than 7 ...

What is the best way to add an image within a div without affecting the layout of the subsequent div?

I have created an HTML form with 4 inputs and a text area using bootstrap. I am looking to add an image to the right of two divs without pushing one of them down. I want it to look like the first image attached, but currently, it looks like the second ima ...

Tips for seamlessly transferring a generated SAS token from a NodeJS Azure Function to an HTML file

I have recently developed a custom API using an Azure Function built with NodeJS. This API incorporates an HTML interface that allows users to upload and download files from Azure Storage containers using SAS tokens. However, I now need to enhance the func ...

Can you code up the CSS and HTML for this design concept?

I have a design mockup that I would like to implement using CSS and HTML. I've started a JSFiddle for it, which currently consists of a table that I need help styling. <table border="1"> <tr> <td>grey</td> ...

Blazor Shared CSS File

Currently, I have successfully implemented 2 pages in my Blazor app: Login.razor located in the Auth folder AddPerson.razor situated in the Profile directory At this point, I have managed to integrate a CSS file specifically for the AddPerson.razor page ...

What is the best way to incorporate these elements into my Bootstrap 5 navbar design?

This is the current layout of my navbar, with the logo in the center. I now want to enhance it by adding a search bar and some icons similar to this example: ideal navbar Here is my current navbar for reference: My current navbar <header> <n ...

Optimal solution: How can we achieve a fixed header and a scrollable body for a table in the

Is there a better way to achieve this? HTML table with fixed headers? Seeking a solution for creating a table with a scrollable body and a static header. After exploring various options, it seems like most available codes are unreliable, not compatib ...

Using CSS to automatically convert a table into one column layout with labels from the thead section

Is it possible to automatically create the labels for data when converting a multi-columns table into one column using CSS and taking the information from the thead section? This resource discusses how to convert a multi-column table into a single column ...

tips for creating a mobile-friendly responsive button

I have been scouring the internet for a solution to this issue. Essentially, I am trying to position the button on the right side in desktop view. Here is an example: chrome view However, when the site is resized or viewed on mobile devices, the button sh ...

Adapting the column width to display or hide content with CSS styling

I have a row with 2 columns. The left column contains my main content and the right column is a chatroom. I would like users to be able to minimize and open the chatroom, which I already know how to do. However, when the chatroom is open, I want the left ...

The Zurb Foundation grid system is causing issues when trying to implement vertical tabs

My vertical tabs are giving me trouble when I try to nest grid or block elements, causing everything to overflow outside the element. For example, in the image below, the numbers 1,2,3 should be in the right section. <div class="row"> <div class ...