The background color transition abruptly stops without any continuation

Within the body element, I have a div with a background CSS that looks like this:

-moz-linear-gradient(center top , #000000 0%, #30FF40 400px) repeat scroll 0 0 transparent

Inside this div is a datatable (jqGrid table). However, once the page loads, the grid table seems to be taking up space on the page causing my gradient background to end abruptly and leaving whitespace at the bottom of the page (other pages without datatables are fine).

How can I resolve this issue?

EDIT:

The problem persists:

PS:

I have identified the source of the problem. There is a div element containing the datatable:

<div id="cont">
...
</div>

Upon webpage load, it appears as:

<div id="cont" style="height: 602px;">
...
</div>

I tried altering the styles of #cont to height:auto, but something keeps overriding it, even when using inline CSS. The CSS for #cont includes:

#cont {
  min-height: 100%;
  margin: 0 auto;
  min-width: 960px;
  max-width: 80%;
}

Any suggestions on how to tackle this issue?

Answer №1

-moz-linear-gradient(center top , #000000 0%, #30FF40 100%) repeat scroll 0 0 transparent

Have you ever tried removing the 400px limit?

Answer №2

Just made an update to my response :) Found that some jQuery code is setting the height for the ID #cont

<style type="text/css>
html, body{ margin:0px; padding:0px; background: #fff; min-width:300px/*480px*/; height:100%;}
.yourClass
{
margin:0; padding:0; display:block; overflow:hidden;
    background: #444444;    background-repeat:repeat;
    background: -moz-linear-gradient(center top, #8db849, #444444);
    width:100%; min-height:100%; 
}
#cont {
  height:320px;/*Estimated height by jQuery / whatever, feel free to remove it later*/
  margin: 0 auto;
  min-width: 960px;
  max-width: 80%;
  background:#0099CC;
}
</style>



<div class="yourClass">
    <div id="cont">
    ...
    </div>
</div>

This change worked well for me, hope it helps!

Answer №3

After some searching, I finally found the solution for you: https://developer.mozilla.org/en/CSS/-moz-linear-gradient. Be sure to read the 'Notes' section for more information. The issue is essentially a "bug" where the background doesn't fill the entire container by default.

To fix this, follow the advice given by @Jonas G. Drange (change the last value to 100%), and then include the following rule in your CSS stylesheet:

html /*<-- or whatever the container element is */
{
    min-height:100%;
}

There you have it!

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

How about we switch the text color to a lovely shade of green?

In the given HTML code snippet, I have the following line: $('#myform #progress').html('<img src="images/ajax-complete.gif" /> Successful.') I simply want to change the text color of Successful to green when it is shown. How can ...

What could be causing the decrease in profits from this particular Javascript function?

In my Bootstrap4 project, I have implemented a multi-select feature alongside a separate div that displays the currently selected options as a series of badges. This is particularly useful on mobile devices where the select element may not provide a clear ...

Spacing issues while utilizing the <textarea> element

<tr> <td> <b>Escalation: </td></b> <td> <TextArea name='escalation' onKeyDown=\"limitText(this.form.escalation,this.form.countdown,100);\" onKeyUp=\"limitText ...

What is the best way to position multiple elements within mat-card-content using Angular, CSS, and HTML

I have been attempting to align the button vertically within the mat-card-content, but without success. The title is currently left-aligned and centered vertically as desired. When I make changes to my HTML or add more divs, the alignment gets worse. http ...

attempting to troubleshoot the issue of missing images on a WordPress website

While using one version of Chrome, I encountered this issue when inspecting an image: <img src="http://esg.com/wp-content/uploads/2016/03/ESG-hudsonlg-01-600x548.jpg?x80200" data-lazy-type="image" data-src="http://esg.com/wp-content/uploads/2016/03/ESG ...

How can Chinese characters be transformed into XML/HTML-style numerical entities and converted into Unicode UTF-8 encoding?

I have a situation where I need to change a text that contains both English words and Chinese characters into a format that includes XML/HTML-style numerical entities for the Chinese characters. Here's an example of the original text: Title: 目录. ...

Managing cookies using JavaScript functions

Is there a way to set a cookie based on the CSS file selected in my HTML? I have a form with a list of options, each representing a different CSS file. I want to save the selected file to a cookie that lasts for a week, so the next time the HTML file is op ...

Tips for properly labeling images

My database consists of three tables. The first table is the images table, which includes fields for picture ID (primary key), names, blob, and description. The second table is the tags table, containing a tag ID (primary key) and tag name. The third tab ...

Distribute uniform width among child elements using CSS styling

In a fixed-width area, I may need to place either four divs or two divs based on different circumstances. If there are only two divs, they should occupy 50% of the width each: On the other hand, if there are four divs, they should be stacked like this: ...

What is the best way to eliminate the Iframe scrollbar while ensuring that the entire page loads?

When I add an Iframe inside the contentArea, two scroll bars appear. I am looking for a way to hide the iframe scrollbar without hiding any of the external website's content. I have tried using the scrollbar="no" snippet code, but it didn&ap ...

Using PHP and JQuery to disable a button after the letter "U" is typed

I am looking for a way to disable the button when the term "U" (defined as Unable) appears. How can I achieve this? Below is the button in question: <input type="submit" class="form-control btn-warning" name="search" value="Search Data"></input& ...

Creating a responsive card layout in Bootstrap 4 that utilizes the vertical space of the viewport with a scrollbar

We are working on a page that has specific requirements: The page should not have a scroll bar. The card must expand vertically to fill the remaining space, even if there is no content in the card-body. We need a scroll bar for the card-body only when the ...

I have created a Joomla Template that incorporates my own CSS through JavaScript. Is there a method to include a distinct version tag to my custom CSS file, such as custom.css?20180101?

My usual method involves adding a unique tag to the css path in the html section, but my template is incorporating custom CSS through Javascript: if (is_file(T3_TEMPLATE_PATH . '/css/custom.css')) { $this->addStyleSheet(T3_TEMPLATE_URL . &apo ...

Issue with Selenium and JUnit - alert not found error message

I have integrated selenium junit into my project. However, upon running the test, I encountered the following error: org.openqa.selenium.NoAlertPresentException: no such alert The expected behavior is to display a confirmation alert after clicking a butto ...

Is there a way to add a dynamic animation of steam rising from a coffee cup to my SVG icon design?

I'm a budding graphic designer eager to master the art of SVG animated icons and coding. Recently, I created an SVG file of a beautiful cup of coffee using Illustrator and now I want to make the steam rise realistically through animation. However, des ...

PHP Arrays and HTML Form Select Elements

I am facing a challenge with a form that contains multiple rows and numerous "select" drop-down menus in each row. While I'm presenting a simplified 2x2 example here, the actual form could extend up to 5x5. Here is an outline of my HTML form: <fo ...

Is it possible to set up a rotation percentage for a specific item?

As shown in the GIF below, when adjusting the window size, the image on the left grows and shrinks as intended. To achieve this effect, I placed a line inside the "image wrapper" that aligns with the text block on the right. Currently, the line is position ...

jquery hover effect not functioning properly

I have a question regarding my jquery mobile application. I am trying to implement a hover effect on items with the class grid-item, where the width and height change simultaneously in an animation. Here is the code snippet I am using: $('.grid-i ...

Mobile device causing issues with Bootstrap navbar toggler functionality

I am having an issue with my Bootstrap 5 navbar. It is not functioning properly on mobile devices. When I click the toggle button, nothing happens. <nav class="navbar navbar-expand-lg navbar-light bg-light"> <div class="contai ...

CSS DROP DOWN NAVIGATION MENU - Struggling to maintain hover effect on main menu item while navigating through sub-menu

I am facing a challenge with a CSS-only drop-down menu where the top main menu item loses its highlight when I move the cursor over the sub-menu items. You can view the menu in action here: . For example, if you hover over "Kids" and then move your cursor ...