Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6384761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:48:55+00:00 2026-05-25T02:48:55+00:00

I have this HTML: <div class=demo>hello world</div> and this CSS: .demo { width: 100px;

  • 0

I have this HTML:

<div class="demo">hello world</div>

and this CSS:

 .demo { width: 100px; 
         height: 50px; margin-bottom: 50px; 
         background-color: red; position: relative;
         z-index:-1;
         filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorStr=#40ffffff,EndColorStr=#12ffffff);zoom: 1;}
 .demo::after { 
         width: 95px; 
         height: 95px; 
         position: absolute; left: 0; top: 0; border: 5px solid blue; content:""; 
         background-color: yellow; opacity: .75;}

I wanted the pseudo element to completely cover the origin element (which contains a 50% gradient for IE7,8 – therefore height: 50%, margin-bottom: 50%;)

However in IE9… the ::after element only covers 50%, although I specifically set the height to be 44px. Is this because of the use of filter? Any idea how to override it?

Here is a JSBin of the example.

Thanks for help.

UPDATE

Here is an example of the whole thing:

Example

Notes:

  • see comments in the background.css file
  • I can’t change the element structure or assign gradient to any other element than .ui-icon
  • The gradient should cover 50% of the footer. Footer is 44px so gradient stops at 22px
  • IE7+8 cannot do this (or color stops), so I making .ui-icon height 22px plus filter-gradient
  • using ::before I add the gradient for all other browsers sitting on top of .ui-icon

Problem 1 = IE9+ renders ::before – I use z-index:-1, so .ui-icon sits behind ::before = OK

Problem 2 = on IE9+ the ::before background is cut off by .ui-icon.

Question: How can I avoid the gradient in ::before being cut off?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:48:55+00:00Added an answer on May 25, 2026 at 2:48 am

    Is this because of the use of filter? Any idea how to override it?

    Yes, it’s because of the filter. Using filter causes an overflow:hidden-esque effect.

    You might be aware that :after is rendered inside the element, like this:

    <div class="demo">hello world<div:after></div:after></div>
    

    If you add overflow: hidden, then all browsers are equally broken: http://jsbin.com/otilux/3


    So, how to fix it? One option is to use ::before to handle drawing the thing that has filter.

    See: http://jsbin.com/otilux/4

    That looks the same as it did before in Chrome/Firefox, and now also looks the same in IE9.

    Due to using ::after instead of :after, I can see you’re not trying to support IE8. So, another option would be to use an SVG gradient instead of filter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this html: <div class=foo parent> <div class=child></div> </div> with some css: .foo{
This is the HTML: <div id=testBlue> <span>hello</span> <span id=testGreen class=testGreen>hello2</span> </div> If I have
I have this HTML code: <div class='com_box'> <div class='com_box_c'> <div class='com_box_info'> <a id='quote'>quote</a> </div>
Suppose I have this html markup: <div id=wrapper> <pre class=highlight> $(function(){ // hide all
Say I have jquery code like this: html += '<div class=index>' + item.index +
I have an html like this: <div id=container1> <div class=dragme>drag me</div> </div> <div id=container2>
I have this HTML in my page <div id='masterDIV'> <div id='divItemNumber'>23</div> <div id='divDesc'>This is
I have this HTML structure and want to convert it to an accordion. <div
i have this code $(function() { $('#ans_vote a span').click(function(){alert('working');return false;});}); and this html <div
OK I have backgrounds set up like this: HTML <div id=container> <div id=content> CONTENT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.