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 8385493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:41:08+00:00 2026-06-09T17:41:08+00:00

Basically, if you look at this you’ll see that I have an element with

  • 0

Basically, if you look at this you’ll see that I have an element with a transform applied to it that has generated content. The :after element is supposed to appear behind the div but it’s not. No amount of !important-ing is having any effect.

How can I get the pseudo-element to appear behind the div?

I don’t care about IE 8 or below.

  • 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-06-09T17:41:10+00:00Added an answer on June 9, 2026 at 5:41 pm

    Although this is strange, and often unwanted behavior, it is also expected. Essentially, transforming an element creates a new stacking context, which in the case of pseudo-elements, means they can no longer sit behind the element they are based on.

    See this article for more information: https://daneden.me/2012/04/22/css-transforms-and-z-index/

    Currently, the only way to resolve this would be to create the new stacking context on the parent element (i.e. create a wrapper element and transform that). Here is an example: http://jsfiddle.net/joshnh/GzWnb/

    HTML:

    <div class="wrapper">
        <div id="box"></div>
    </div>
    

    CSS:

    .wrapper {
        -moz-transform: rotate(10deg);
        -webkit-transform: rotate(10deg);
        transform: rotate(10deg);
    }
    #box{
        width: 200px; 
        height: 200px;
        left: 100px;
        top: 100px;
    
        background:blue; 
        position: absolute;
        &:after{
            content: "";
            width: 100px;
            background: orange;
            height: 100px;
            position: absolute;
            left: 120px;
            top: 120px;
            z-index: -2!important;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a three models that look (basically) like this: class User <
I have a set of tables which basically look like this AGENCY - AGENCY_NAME
I have two tables that look like this: Products: id category name description active
Look at this complex type, which is basically a DTO that wraps some entities.
I want to highlight only keywords that look like this: {KEYWORD} (basically UPPERCASE words
I have a list of strings that look like this: abc|key1|486997 def|key1|488979 ghi|key2|998788 gkl|key2|998778
I have some controls in columns that I would like to look like this,
I'm making a legend for a graph that will basically look like this: [
Please look at this picture Basically you swipe your finger down in that area
I have a simple ASP.NET page with paging support. Basically just hyperlinks that look

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.