The content does not fill the entire page's height

I am facing an issue with a linear-gradient background image that does not extend to cover the entire content height.

I have experimented with different solutions like using min-height: 100% and adjusting the positioning of the html and about-body divs, but I haven't been successful. How can I make sure the html height accommodates all the content?

html {
    width: 100%;
    min-height: 100%;
overflow-x: hidden;
overflow-y: scroll hidden;
background-image: linear-gradient(#d580ff, #ffcc99);
}

/* Nav bar */
#pageNavBar { ... }
#header-text { ... }
#nav-links { ... }
.nav-link { ... }

/* About */
#about-body { ... }
#about-body-header { ... }
#aboutImg { ... }
#aboutTxt { ... }
<body>

<!-- Navigation -->

    <div id="nav-links">
      ...
    </div>

<!-- Main page body below nav bars -->

<div id="about-body">
<div id="about-body-header">About Me</div>
<img src="/images/image.png" id="aboutImg" />
<p id="aboutTxt">
...
        <br /><br />
...
        <br /><br />
</p>
</div>

</body>

Answer №1

In your code, there are several unconventional practices being used such as an old clear fix, using 'top' for relative positioned elements, and using 'vw' for top alignment instead of 'vh.'

By replacing the #about-body top property with margin-top, the issue can be resolved.

It seems that when using top, the height of the wrapping element does not change, causing it to overflow the container instead. This behavior is in accordance with the specification outlined here: https://www.w3.org/TR/CSS2/visudet.html#Computing_heights_and_margins

I advise against using top for relative positioned elements as it can lead to confusing outcomes.

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

What is the best way to position a <label> to the left of an <input> field?

Examining the HTML and CSS code below: * { box-sizing: border-box; } .field { overflow: auto; } .field label { float: left; width: 80px; } .field input { display: block; width: 100%; } <div class="field"> <label>Test< ...

Why is PHP unable to identify the custom-designed CSS button upon submission?

I'm having a design issue where the button on my form is not being detected. I've tried various methods like changing the class name, assigning it a name via HTML, but nothing seems to work. Here is my button: .blue_button { background: #005b66; ...

What is the best way to align this image in the center?

I've been struggling with this problem for a while now and can't seem to find a solution. I need to center align this image within the form, but everything I've tried so far has been unsuccessful. It may seem like I'm providing too much ...

Displaying/Concealing specific choices using jQuery

Greetings! I am in need of some assistance with my coding query. I have been working on a piece of code where selecting 'x' should reveal another dropdown, which seems to be functioning correctly. However, if I navigate three dropdowns deep and t ...

Using Jquery to dynamically add or remove a class based on scrolling behavior

Can someone help me with identifying the position of an element so that when the user scrolls to it and it appears on the screen, an icon can be highlighted? Currently, the script I am using adds the class too early, closer to the bottom of the block. I w ...

The Div overlay vanishes once the Javascript function is finished running

Initially, take a look at this fiddle: http://jsfiddle.net/ribbs2521/Q7C3m/1/ My attempt to run JS on the fiddle has been unsuccessful, but all my code is present there, so we should be fine. I was creating my own custom image viewer, and everything was ...

The CSS cursor style is taking precedence over the inline cursor style while dragging items in the list

I am currently utilizing the Nestable JS library and have a list of nestable items in my tree. I am trying to implement a cursor: pointer when hovering over them and a cursor: move when dragging. However, I am facing issues in getting this functionality to ...

Error in scrolling previews detected in Jssor horizontal template maker

I've been working with Jssor Slider Maker and I'm using the vertical preview template that features two columns on the left side and a maximized image on the right side. After pulling the code from the developers pack, it includes scripts, CSS an ...

Validate all JavaScript buttons by binding a click event

I've implemented the JS validation plugin from this source and it's functioning properly. However, it captures all button clicks on the page, including when I click on Back to Home, triggering form validation unnecessarily. I only want the form ...

HTML5 body content and footer area

I'm working on a website with the main content area set to 95% width, but I'm facing an issue - I want the footer to be 100% width even though it's a child of the main content, which limits its width. Is there a way to make the footer overr ...

Issue with absolute positioning in IE6 and IE7 not functioning correctly

I recently created a website for a friend that involves absolute positioning within a relative positioned div. After testing it in various browsers using Browserlabs, I found that it works well except for IE6 & IE7. Despite searching online for solut ...

Elements being impacted by the CSS Transition are being pushed

I am facing a CSS issue that I just can't seem to resolve. If you visit and check out the top search bar. On hovering over it, you'll notice it resizes to fit the content width. This is the CSS code responsible for this: .header .search-wrap ...

Creating Vertical Text and Div Blocks using CSS

Trying to set up different color section blocks with vertical text on my website's dashboard page. Similar to this example in JSfiddle: http://jsfiddle.net/afpn2y19/4/ <div id="outer"> <div id="inner"> //Feeling lost - ho ...

Backend data displayed on carousel presents either all images or none at all

I am currently working on a Django project that involves displaying a list of images in a Carousel format within my template. I have encountered an issue with setting the active class for the Carousel items. When I include the "carousel-inner active" clas ...

Is it possible to open a new tab window using a radio button?

Looking for assistance with radio buttons. I want users to be redirected to a new window when they click the submit button beneath the radio buttons. If anyone has a solution, please help! I have tried using window.location.href and window.open but the c ...

Tips for dynamically updating the id value while iterating through a class

Here's the HTML snippet I am working with: <div class="info"> <div class="form-group"> <label class="control-label col-sm-2">Title</label> <div class="col-xs-10 col-sm-8"> <inpu ...

Text material is visible beyond the boundaries of the div

Recently, I experimented with creating div elements in different shapes such as triangles and trapezoids. HTML: <div class="triangle">Hello! Nice to meet you all.</div> CSS .triangle { width: 0; height: 0; border-left: 50px soli ...

Having trouble retrieving dynamic data from a JSON array

I am working with a JSON array. JSON.stringify(ar) When I attempt to display the results in an alert: alert(JSON.stringify(ar)); The output displayed in the alert is: [{"url":"link1","title":"title1"}] However, when I try to transfer the contents i ...

Using the <a href> tag to send emails directly from within an HTML document

I am working on creating a basic HTML page using a free web template I found online. In the "contact" section, I want to configure it so that <a href= "mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="92fff7d2f5fff3fbf ...

How to Extract Information from a Table Enclosed in a Div Using HTML Parsing?

I'm new to HTML parsing and scraping, looking for some guidance. I want to specify the URL of a page (http://www.epgpweb.com/guild/us/Caelestrasz/Crimson/) to grab data from. Specifically, I'm interested in extracting the table with class=listing ...