When the height exceeds the window in IE8, the -ms-filter background vanishes as the scrollbar appears

When the height of a div is greater than the window in IE8, the background specified with -ms-filter disappears. However, this issue does not occur in IE7 and earlier versions. (One workaround could be using a 1px transparent image, but what if I want to use a transparent color along with a background image?)

Check out the sample code and fiddle below:

<!DOCTYPE html>
<html lang="sk">
<head>
    <meta charset="utf-8">
    <style>
        html,body{height:100%;margin:0;padding:0;}
        #one{
            float:left;
            height:100%;
            width:50%;
            background:rgba(0,0,0,0.5);
            -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#CC917C6F,endColorstr=#CC917C6F)";
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#CC917C6F,endColorstr=#CC917C6F);
        }
        #two{
            float:right;
            height:101%;
            width:50%;
            background:rgba(255,0,0,0.5);
            -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#CCAAAA6F,endColorstr=#CCAAAA6F)";
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#CCAAAA6F,endColorstr=#CCAAAA6F);
        }
    </style>
</head>
<body>
    <div id="one"></div>
    <div id="two"></div>
</body>
</html>

http://jsfiddle.net/9dmqg/4/ Thank you.

Answer №1

The reason for this issue is the fixed height set for the p tag. To resolve it, change the fixed height to min-height and include height:auto

#first p {
     height:auto; min-height:800px;
}
#second p {
    height:auto; min-height:800px;
}

See Demo

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

Retrieving and storing information from a form without the need to submit it

I have been given the task of creating a load/save feature for a complex form. The goal is to allow users to save their progress and resume working on it at a later time. After much consideration, I have decided to implement server-side storage by saving ...

How can I incorporate a custom color into a preset navbar on an HTML webpage?

<div class="navbar-header"> <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" style="color: blue;" class="navbar-toggle collapsed" type="button"> <i class="fa fa-reo ...

I am perplexed by the CSS property `height: auto;` which seems to be making the element taller than necessary. How exactly is

Currently, I am dealing with some HTML/CSS aspects of an already established WordPress website. It appears that there might be an issue related to the theme's CSS causing this problem, although it is not immediately apparent. Specifically, there is s ...

Tips for positioning the search bar on the opposite side of the navbar in Bootstrap 5

In my navbar, I have items aligned on the left and a search bar aligned on the right. However, when I try to move the items to the right using the ms-auto class, only the items move and the search bar stays in place. How can I adjust the alignment so that ...

Using an HTML file as the source for an image in the <img src=""> tag is a simple process that can greatly enhance the visual appeal of your webpage

My goal is to utilize an html file as the source for an image file within the <img src=""> tag in order to prevent mixed-content warnings when using an http image over https. For instance: index.html: <img src="./image.html" > image.htm ...

Having trouble accessing NSE Bhavcopy zip file in R due to a HTTP status of '403 Forbidden'

My current project involves automating the process of downloading a zip file in R. On the specific webpage I am working with, I can easily download the zip file by clicking on it or by right-clicking and saving the file. However, my challenge lies in down ...

Transferring the dirty state of the view to the parent form

Within my main form's markup, there is a specific structure that includes a tabset and a selectView method in the controller: <tabset vertical="true" type="pills"> <tab ng-repeat="tab in tabsViews" sele ...

Adjusting the grid for various mobile screen sizes

I am currently working on designing a user interface (UI) for mobile screens that includes a header, grid, and buttons. I want the UI to look consistent across all mobile devices. Here are screenshots from various mobile screens: Samsung S5 Pixel 2 XL I ...

Troubleshooting a problem with a personalized webkit scrollbar in Chrome

Using the CSS property scroll-snap-type: y mandatory; to customize my scrollbar with the following styles: ::-webkit-scrollbar { width: 12px; background: transparent; } ::-webkit-scrollbar-track { background-color: rgba(0, 0, 0, 0.5); -webkit-box-s ...

Using JavaScript to dynamically retrieve element IDs

Within the content on my page, there are multiple tables displaying product information along with their respective authors. Additionally, there is a div that contains hyperlinks for each author. Currently, I am linking the authors' names to hyperlink ...

Tips on utilizing the PHP json_decode() function with an array of JSON objects

I am having some trouble with an array of PHP objects that are json_encoded. I want to display these objects in a table in HTML, using the object's attributes as rows in the table. However, when I decode the JSON objects one by one in a for loop and d ...

What is the reason behind the body element's background styling impacting the entire screen?

Why does styling the background of the body element affect the entire screen instead of just the body itself? For example, consider this CSS rule: body { width: 700px; height:200px; border: 5px dotted red; background-color: blue; } While the ...

Identify the CSS class for the ionic component on the webpage

Currently, I am in the process of developing an application using ionic 2 and angular 2. Within this app, I am utilizing the ionic 2 component known as ModalController. Unfortunately, I have encountered a challenge when attempting to adjust the size of th ...

The vertical spacing in the footer navigation list is excessively large

Trying to create a footer with four columns that contain anchor tags using Bootstrap 4.4 nav classes. The columns are set up correctly but there is too much vertical padding between each nav item. I've attempted to adjust this without success. As show ...

The edge of the 'parent' element is obscured by the :after element

I am trying to create a transparent outlined button with a shadow in the shape of the button. However, I am facing an issue where the border of the button appears behind the :after element. You can see the problem below. Adding overflow: hidden to the tog ...

What is the process for using javascript to close the existing tab?

I'm trying to figure out how to close the current tab using JavaScript, but I haven't been able to find a solution. I've searched all over the internet and some posts suggest the following code: $("#click").click("click", function(element) ...

Create a PDF on-the-fly by leveraging Vuejs to dynamically pull data and design elements

Is it possible to create a form that captures name, expiry date, and picture, and upon submission generates a PDF document with the provided details? The PDF should be based on a design created by me and have the input data displayed in a specific location ...

Creating adaptable horizontal grids is straightforward with these steps

Is it possible to create a 3 horizontal responsive grid using only CSS and HTML, without relying on any framework? I've attempted it but am struggling to come up with a solution. ...

Issues with properly triggering re-clicking events in AngularJS when using Bootstrap modal

I am currently utilizing Angular JS in combination with Bootstrap modal. Below is the Anchor link I am referring to: <li><a href="#" data-toggle="modal" data-target="#inviteFriendModal" ><span class="frndInvt"></span>Invite Friends ...

Optimizing CSS to eliminate extra space from the first button in the navigation menu bar

I'm currently working on creating a simple CSS-based navigation bar, but I've encountered an issue. The first item in my HTML list seems to have extra space to its left that I can't seem to remove. Check out the live example here Also avai ...