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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:21:02+00:00 2026-05-28T00:21:02+00:00

I have the following code: http://jsfiddle.net/cosoroaba/nCEwv/ HTML: <div id=square> <div class=corner-wrapper> <div id=ctr></div> </div>

  • 0

I have the following code:
http://jsfiddle.net/cosoroaba/nCEwv/

HTML:

<div id="square">
    <div class="corner-wrapper">
        <div id="ctr"></div>
    </div>
</div>

CSS:

#square {
    border: 1px solid #CCCCCC;
    display: block;
    height: 400px;
    line-height: 400px;
    margin: 50px auto;
    overflow: hidden;
    position: relative;
    text-align: center;
    width: 400px;
}
.corner-wrapper{
  -webkit-transform: rotate(45deg);  
     -moz-transform: rotate(45deg);  
      -ms-transform: rotate(45deg);  
       -o-transform: rotate(45deg);  
          transform: rotate(45deg);
    clip: rect(0px, 141.421px, 70.7107px, 0px);
    height: 141.421px;
    position: absolute;
    right: -20.7107px;
    top: -20.7107px;
    width: 141.421px;
}
#ctr{
 -webkit-transform: rotate(-45deg);  
     -moz-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
       -o-transform: rotate(-45deg);
          transform: rotate(-45deg);
    left: 20.7107px;
    top: 20.7107px;
    background-color: blue;
    display: block;
    height: 100px;
    position: absolute;
    width: 100px;
}

#ctr:hover{
    background-color: green;
}

#ctr:active{
    background-color: red;
}

I’m rotating the wrapper in one direction and the content in the opposite direction, then cutting the wrapper in half using clip, to achieve a “triangle”-div

which works well on FF,Chrome and Opera

but there is this issue in IE9 http://www.screenr.com/ikos

hover is triggered on the content in IE9 even if it would be hidden by the wrapper

  • 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-28T00:21:03+00:00Added an answer on May 28, 2026 at 12:21 am

    I’d refactor your code, there’s a lot of unnecessary transformations going on, and if you change the size of your container your have to recalculate everything. I haven’t checked in IE9 but this should work:

    <div id="square">
            <div id="ctr"></div>
    </div>
    

    CSS

    #square {
        border: 1px solid #CCCCCC;
        display: block;
        height: 400px;
        line-height: 400px;
        margin: 50px auto;
        overflow: hidden;
        position: relative;
        text-align: center;
        width: 400px;
    }
    
    #ctr{
     -webkit-transform: rotate(-45deg);  
         -moz-transform: rotate(-45deg); 
          -ms-transform: rotate(-45deg); 
           -o-transform: rotate(-45deg); 
              transform: rotate(-45deg);
        -webkit-transform-origin: 0 0;
        -moz-transform-origin: 0 0;
        -ms-transform-origin: 0 0;
        -o-transform-origin: 0 0;
        transform-origin: 0 0;
        right: 0;
        top: 0;
        background-color: blue;
        display: block;
        height: 150px;
        position: absolute;
        width: 100px;
    }
    
    #ctr:hover{
        background-color: green;
    }
    
    #ctr:active{
        background-color: red;
    }
    

    jsfiddle:
    http://jsfiddle.net/exKJK/

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

Sidebar

Related Questions

I have the following code: http://jsfiddle.net/YfzbZ/ HTML <dl class=dropdown right> <dt><a>Options</a></dt> <dd> <ul style=display:none;>
I have following code (live: http://jsfiddle.net/xyZY8/1/ ): var str = '<div>hello</div><ul><li>Some text...</li>' + '<li>second
I have following code (html,js,jquery) snippet ( http://jsfiddle.net/MUScJ/2/ ): <script type=text/javascript> function someFunc(){ html
I have the following code: http://jsfiddle.net/3fT2M/ Why isn't the two floated div background color
I have the following code: http://jsfiddle.net/dbg5X/ Is it possible to have the second div
I have the following code in HTML/CSS: http://jsfiddle.net/XmRNh/ As you can see, there is
I have the following code: http://jsfiddle.net/SPWWx/ I'm completely new to javascript, this is my
let's i have the following code http://jsfiddle.net/QhJWt/ <span contentEditable=true>asdfasdf </span> span { height:20px; width:100px;
I have the following code at http://jsfiddle.net/qPtXL/ As you can see the problem is
I have the following code at JSfiddle: http://jsfiddle.net/ACG2D/ $(document).ready(function() { $('.testThis').click(function() { $('.regexValidation').each(function() {

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.