1 The scale factor, where 1 stands for the original size, 2 for twice the size, and so on. The element is both scaled horizontally (x-axis) and vertically (y-axis) by the same factor. Negative values mirror the element.
2Optional. The vertical scale factor. If given the factor noted at 1 stands for the horizontal change. In this case the element gets scaled by the factor 2 horizontally and 1.5 vertically.
1 The element is tilted around the x-axis (horizontally) by 30 degrees. Positive values represent a tilt to left, negative values tilt the element to the right.
2Optional. The angle for the tilt around the y-axis (vertical). If given the value at 1 represents the angle for a tilt around the x-axis. Positive values tilt the element downwards, negative values represent a tilt to the top. In this case the element gets tilted by 30 degrees horizontally (to the left) and 10 degrees vertically (downwards).
For more info see the W3C site, the Safari site and the site at MDN (including compatibility info for older browser versions).
transform: translate
Is used to move elements. Can also be achived by setting the margin or by positioning the element although translate is the better choice for animating elements.
1 The element is moved 100px to the right. Negative values represent a shift to the left.
2Optional. The vertical shift. If given the value at 1 stands for the horizontal movement. Positive values move the elements downwards, negative values shift it upwards. In this case the element is moved 100px to the right and 20px down.
1 The horizontal position of the origin for transformations (x-axis). May also be a percentage value where 0% stands for left, 50% for center and 100% for right. Between values are possible as well as length values with the reference point at the top left corner. Negative values are possible in each case. By default the origin of the transformation is both horizontally and vertically at the center of the element (50%50%).
2Optional. The vertical position of the origin. 0% stands for top, 100% for right. The rest from 1 also applies here.
For more info see the W3C site, the Safari site and the site at MDN (including compatibility info for older browser versions).
x The live example can be examined using an element inspector like Firefox’s Firebug. Many browsers already have such an inspector build in. In each case right click on the example and then select “Inspect element”. Now an area in your browser opens where you see the HTML code of the example on the left side and the CSS on the right side for further investigation.
I had to say that; best visual explanation ever! Awesome job!
Shail Paras
hi… i have used transform:scale(0.333333,0.333333); …..
it is working in Chrome fine but in Firefox … border get hide or something….
i don’t understand what is happening with firefox…. HTML
But since you scale it down to just a third with transform:scale(0.333333,0.333333) you can’t see the border anymore, because 1/3 of 0.02in (which is actually just one pixel) is almost equal to zero and thus can’t be displayed. Try to remove the transformation at the above-noted example and you will see that the border reappears.
Shail paras
Thanks Chris…
Actually i have found other way to do that… without tranformation.
actually
i was making a grid with border and also have given option to zoom
in/out the grid… now i have added different color in all grid boxes…
so now there is no issue of border.
thanks again for REPLY…
and i have learn more from your site…
thank u very much..
Aldash
Very useful, I bookmarked it.
Partus
Thanks! I bookmarked too.
http://realwebdesigns.com/ Filipe Valente
How would I make it rotate clockwise continuously? thanks
http://www.css3files.com Christian Krammer
What exactly do you mean with “continiously”? An animation or just to rotate an element? If the latter, then it’s just rotate: transform(XXdeg) where “XX” stands for the size of the angle for the rotation. If you mean the former please further specify your question.
http://www.brentonstrine.com Brenton Strine
I think he’s asking how to have it rotate about its axis continually, similar to a little “loading” indicator or something. I assume this takes javascript, but it would be interesting if it could be done with CSS.
http://www.css3files.com Christian Krammer
Involving animations its not that difficult. If you want to know more about that, just drop me a line at the contact form. I might also write a blog post about that.
http://www.heavyhookedup.com Brian
Great, thank you, very useful website.. Thanks again
http://www.folkd.com/detail/quizilla.teennick.com%2Fstories%2F19711889%2Fstrompreise-vergleichen-hannover Erwin H.
Greetings from Florida! I’m bored to death at work so I decided to browse your blog on my iphone during lunch break. I enjoy the info you provide here and can’t wait to take a look when I get home. I’m surprised at how quick your blog loaded on my mobile .. I’m not even using WIFI, just 3G .. Anyways, fantastic blog!
ram
Hi Christian,
Your website has really proved very helpful for me to learn CSS3. thanks a lot…and it’s really a nice looking site..
I have a question and that is:
How to create a comment box like you are using in your website…it’s very clear , good looking comment box and as I am new in coding, I really don’t know how to perform server side coding for comment box.
Many thanks in advance.
http://www.css3files.com Christian Krammer
It was a tough piece of work to find a solution for the most recent comments since there are no workable plugins as far as I know – and I searched for a really long time. But then I encountered a pretty “dirty” solution which uses a direct query to the WordPress database and retrieves the comments and the related values. Unfortunately I haven’t saved the URL of where I found this solution, but I have e-mailed the file to you. If anybody else is interested just drop me a line.
veera
Very useful, I bookmarked it.
Benne
Sehr Nützlich die Seite.
Very useful Page
Greetz from Germany
2pha
Having anything more than a couple of things skewed on one page and IE9 starts acting up, disappearing content etc. Well…atleast for me..
9 versions of IE and still they have not got it right….
Very nice post. I just stumbled upon your
weblog and wished to say that I have truly enjoyed surfing around your blog
posts. In any case I’ll be subscribing to your rss feed and I hope you write again very soon!
http://www.css3files.com Christian Krammer
I hope so too! : ) On one hand I need an interesting topic and on the other hand some time. But a new post is already scheduled for the coming days.
http://dj247.net/dj DJ
Very nice post
thanks
Zeron
Very useful.
Will you write some examples of perspective?
Chris_Krammer
Since 3D-transformations are a pretty extensive topic and only needed in very special circumstances I didn’t consider it so far. But if there’s a demand for this property I could add it of course.