CSS Transform and Shapes Generator
Stack rotate, scale, skew and translate functions, drag the preview, set transform-origin and copy CSS, or design pure-CSS triangles and bubbles.
브라우저에서 실행됩니다. 파일은 기기 밖으로 나가지 않습니다. 확인하는 방법 보기
…
사용 방법
- 1Add functions
Pick a transform function and press Add; repeat to build the list.
- 2Adjust values
Use the sliders and unit selectors on each row, and reorder rows.
- 3Set the origin
Tap one of the nine origin buttons or type exact percentages.
- 4Drag the preview
Move the box and rotate it with the orange handle, or use arrow keys.
- 5Make a shape
Switch to CSS shapes and choose triangle, arrow or speech bubble.
- 6Copy the CSS
Copy or download the generated rules into your stylesheet.
이 도구 소개
The transform property moves, turns, stretches and slants an element without changing the layout around it, which makes it the cheapest way to animate on the web. The catch is that the functions are applied in order, from right to left, so rotate(45deg) translateX(100px) and translateX(100px) rotate(45deg) end up in different places, and transform-origin moves the pivot point for everything. Getting the numbers right by trial and error in DevTools takes time. This generator keeps an ordered list of transform functions, each with its own slider, and shows the result live on a sample box with a dashed outline of where the box started. You can drag the box to translate it and drag a handle to rotate it, use the keyboard for precise nudges, and read the matching CSS, the single matrix() equivalent and the individual translate, rotate and scale properties when they apply. A second tab builds the shapes people still search for every day: CSS triangles, arrows and speech bubbles with a tail.
Building a transform
Add functions from the list: translate, translateX/Y/Z, rotate, rotateX/Y/Z, scale, scaleX/Y, skew, skewX/Y and perspective. Each row shows its CSS, a slider per argument and, for lengths, a unit choice of px, % or rem. Percent in translate means percent of the element's own size, which is how centring with translate(-50%, -50%) works. Move rows up to change the order and watch how the result changes. The nine origin buttons set transform-origin to a corner, an edge centre or the middle, and number fields allow any other value.
Direct manipulation
Drag the box body to translate and the orange handle to rotate; each drag is one undo step. With the preview focused, arrow keys move by 1 px, Shift with an arrow moves by 10 px, and R or Shift+R rotates by 15 degrees in either direction. For rotateX and rotateY to show depth, switch on parent perspective; smaller values give a stronger effect. Turning off back-face visibility hides the box when it is flipped past 90 degrees, as in card-flip effects.
Matrix and individual properties
When every function is 2D and every length is in pixels, the tool multiplies the functions into one matrix(a, b, c, d, e, f). This is what getComputedStyle returns, so it helps when you need to compare with a value read from the browser. When the list is only translate, rotate and scale, each used once, it also writes them as the newer individual properties, which can be animated separately.
Shapes
Triangles come in eight directions, built either with the classic border trick (solid colour, works everywhere) or with clip-path polygon (works with gradients and images). Arrows use clip-path with adjustable shaft thickness and head length. Speech bubbles get a ::after tail on any side, with position, size and corner radius controls.
Limits
The matrix output is not produced for percentage or rem lengths, because their pixel value depends on the element and font size, and 3D functions would need matrix3d, which the tool does not write. The preview box is a fixed size, so check percent-based values on your real element.
풀이 예시
A designer wants a promo badge that tilts and pops out of a card. Starting from translate(20px, -10px) rotate(15deg) scale(1.1), she moves the origin to the top-left corner so the badge pivots on its pin, then drags the rotate handle back to 12 degrees. The CSS reads transform: translate(20px, -10px) rotate(12deg) scale(1.1) with transform-origin: 0% 0%, and the matrix equivalent is matrix(1.0759, 0.2287, -0.2287, 1.0759, 20, -10). On the shapes tab she adds a down-pointing triangle 24 px wide and 12 px high in the badge colour: border-width 12px 12px 0 12px with only the top border coloured.
한눈에 보기
- 카테고리: 개발 및 데이터
- 브라우저에서 실행되며 가입도 업로드도 필요 없습니다.
- 입력한 정보는 기기에 머뭅니다.
- 영어로 제공됩니다.
- 콘텐츠 최종 검토일:
- 공식 출처: W3C CSS Transforms Module Level 1 and Level 2
자주 묻는 질문
Why does the order of functions matter?
Each function transforms the coordinate system for the ones written before it, so they apply from right to left. Translating then rotating is not the same as rotating then translating.
What does transform-origin change?
The fixed point for rotation, scaling and skewing. The default is the centre; 0% 0% pivots around the top-left corner.
Why do my 3D rotations look flat?
Without perspective there is no depth. Switch on parent perspective, or add a perspective() function at the start of the list.
Border triangle or clip-path?
Borders give a solid colour and work in every browser. clip-path keeps the element's full box, so gradients, images and box backgrounds show inside the triangle.
What are the individual transform properties?
translate, rotate and scale can be set as separate CSS properties and animated independently. They are applied in a fixed order: translate, then rotate, then scale.
Is my work saved?
The current settings are saved as a draft in this browser. Undo and redo cover slider changes, drags and list edits.
