1

I tried to create the CSS3 transform simple demos, i got struck as i am not able to see the element is rotating when i use transform:rotate(180deg)

see the codepen:http://codepen.io/shmdhussain/pen/yYMWba

HTML:

<div class="box transz"></div>
<div class="box rotatex"></div>

CSS:

.box {
    background-color: red;
    width: 100px;
    height: 100px;
}

.transz {
    /*Translate Z transform*/
    transform: translate3d(100px, 200px, 100px);
}

.rotatex {
    transform: rotate( 180deg);
}

1 Answer 1

1

I'm confused as to your confusion. For me, your codepen works just fine. The rotate transformation takes the original shape and rotates it one time by the number of degrees you specify. In your case, you're just rotating a square by 90/180/270 degrees, which will look identical to the original. If you rotate by something like 45 degrees, you should see a result. Apologies if there is a more complex problem I'm not seeing!

Sign up to request clarification or add additional context in comments.

6 Comments

got confused in simple calc, sorry for that. Got it. any clue about transition on z-axis transform: translate3d(100px, 200px, 100px);
Moreover I am using the perfect square so that only I am not able to see the rotation in 90,270 deg. Got the point. any help in translate3d
No problem, but what do you mean? What behavior are you looking for from that transform? The code you have there should just move your square a little bit.
Is translate3d is working on my code? ... is there any value in z-axis to easily perceive the changes
I think we need perspective and transform style to do that.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.