Comments on: transform-origin https://css-tricks.com Tips, Tricks, and Techniques on using Cascading Style Sheets. Thu, 02 Feb 2023 00:50:44 +0000 hourly 1 https://wordpress.org/?v=6.4.3 By: Göran https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1802815 Thu, 02 Feb 2023 00:50:44 +0000 http://css-tricks.com/?page_id=17442#comment-1802815 Is there any special reason you are using
transform-origin: top left
instead of
transform-origin: left top ?
I would have thought the first value refers to horizontal position whereas the second value refers to vertical position. Or is it the case that the order of values does not matter when using keywords such as left, right, center, top etc?

]]>
By: GermanChris https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1652674 Mon, 15 Oct 2018 10:37:00 +0000 http://css-tricks.com/?page_id=17442#comment-1652674 In reply to Steve.

I just had the same problem and solved it like this:
– you first have to flip the DIV to the left (rotate -90) on its bottom left corner.
– then you shift it to the right (left: Xpx) by the exact amount of pixels as the original height !
Result: the original top-left corner has moved to the original bottom left corner and thus scaling works as expected.
Here’s the html code:

test

and css:
.vertical {
height: 30px;
width: 60 px;
transform-origin: bottom left;
transform: rotate(-90deg);
left: 30px;
}
regards,
GermanChris

]]>
By: Edd https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1603311 Mon, 08 Aug 2016 16:01:35 +0000 http://css-tricks.com/?page_id=17442#comment-1603311 In reply to trisha.

Welcome to CSS Tricks!

]]>
By: Dom https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1603105 Wed, 27 Jul 2016 18:43:04 +0000 http://css-tricks.com/?page_id=17442#comment-1603105 Well I’ve been looking for this all freaking day. Thanks Chris.

]]>
By: Korey https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1599322 Tue, 26 Jan 2016 16:42:15 +0000 http://css-tricks.com/?page_id=17442#comment-1599322 In reply to Steve.

Did you ever find out the solution to this?
Because this is the EXACT problem that I am having….

]]>
By: Gopal Sharma https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1598298 Sat, 28 Nov 2015 08:48:37 +0000 http://css-tricks.com/?page_id=17442#comment-1598298 Hello ,
This is good, but can anybody help me for this complicated task…
I want to make a div which have bottom-right corner edge is longer then the Top-right corner edge(i.e.. Lower line is longer than the upper one). How can achieve this ?

]]>
By: Brian Ellis https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1594296 Wed, 06 May 2015 16:36:37 +0000 http://css-tricks.com/?page_id=17442#comment-1594296 In reply to whole cat.

You’d simply use the tag attribute transform-origin: initial; as reset value. See Transform Origin Attributes

]]>
By: Brian Ellis https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1594295 Wed, 06 May 2015 16:33:05 +0000 http://css-tricks.com/?page_id=17442#comment-1594295 In reply to trisha.

Unless you’re talking about fallback coding CSS tricks are for CSS tricks, rarely is JS used anywhere for the actual affect. If you refer to Codepen you can see there is minimal JS and no libraries are used. This would defeat the CSS workaround in the first place. As such though besides IE9(and lower) vendor prefixes should support all other browsers for these methods in most cases.

]]>
By: whole cat https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1592865 Sat, 28 Feb 2015 20:26:50 +0000 http://css-tricks.com/?page_id=17442#comment-1592865 Hi!
Tell me, please, can i specify transform-origin for rotation only and disable this effect for other properties.

]]>
By: Steve https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1592501 Tue, 10 Feb 2015 21:29:35 +0000 http://css-tricks.com/?page_id=17442#comment-1592501 Hi. I’m wondering if this might be a way solve an issue I’m having.

I’ve used transform: scale(.5,.5); but my margins behave as though the item has not been scaled. When I resize the browser, the left margin cause the item to push away from the edge. When I inspect elements and turn off the transform, I can see that the item is reacting to the original size (pre-transform).

Is there a way to use transform-origin to correct this? I tried transform-origin: 25%50%; however the problem persists, just at different proportions.

I am referring to the bottom image on this page: stephendanison.com/mondrian

]]>
By: Benjamin Reid https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1583185 Thu, 26 Jun 2014 13:09:41 +0000 http://css-tricks.com/?page_id=17442#comment-1583185 In reply to trisha.

You’d be best of using https://github.com/madrobby/vapor.js, pretty good for implementing these transforms.

]]>
By: Siubeans https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1315292 Wed, 12 Mar 2014 02:29:45 +0000 http://css-tricks.com/?page_id=17442#comment-1315292 In reply to trisha.

None, it’s pure CSS.

]]>
By: trisha https://css-tricks.com/almanac/properties/t/transform-origin/#comment-1237586 Mon, 03 Mar 2014 21:59:41 +0000 http://css-tricks.com/?page_id=17442#comment-1237586 what jquery library should i use for this code?

]]>
By: rohan Saka https://css-tricks.com/almanac/properties/t/transform-origin/#comment-791282 Mon, 09 Dec 2013 07:14:02 +0000 http://css-tricks.com/?page_id=17442#comment-791282 Css- tricks.com is really usefull for web designers.. :)

]]>