{"id":4800,"date":"2026-01-09T19:25:07","date_gmt":"2026-01-09T10:25:07","guid":{"rendered":"https:\/\/dennie.tokyo\/it\/?p=4800"},"modified":"2026-02-02T19:24:42","modified_gmt":"2026-02-02T10:24:42","slug":"%e3%80%90css%e3%80%91transform-origin","status":"publish","type":"post","link":"https:\/\/dennie.tokyo\/it\/?p=4800","title":{"rendered":"\u3010CSS\u3011transform-origin"},"content":{"rendered":"\n<p>transform-origin \u306f\u5909\u5f62\u3055\u305b\u308b\u8981\u7d20\u306e\u8d77\u70b9\u5ea7\u6a19\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h1 class=\"wp-block-heading\">\u6307\u5b9a\u65b9\u6cd5<\/h1>\n\n\n\n<p>\u8d77\u70b9\u306e\u4f4d\u7f6e\u3068\u306a\u308bx\u3001y\u3001z\u5ea7\u6a19\u3092\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3067\u533a\u5207\u3063\u3066\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>transform-origin:x\u5ea7\u6a19 y\u5ea7\u6a19 z\u5ea7\u6a19;<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u5024<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>left: \u8d77\u70b9\u306ex\u5ea7\u6a19\u3092\u5de6\u7aef(0%)\u306b\u3057\u307e\u3059\u3002(x\u5ea7\u6a19\u306e\u6307\u5b9a\u306b\u6709\u52b9)<\/li>\n\n\n\n<li>right: \u8d77\u70b9\u306ex\u5ea7\u6a19\u3092\u53f3\u7aef(100%)\u306b\u3057\u307e\u3059\u3002(x\u5ea7\u6a19\u306e\u6307\u5b9a\u306b\u6709\u52b9)<\/li>\n\n\n\n<li>top: \u8d77\u70b9\u306ey\u5ea7\u6a19\u3092\u4e0a\u7aef(0%)\u306b\u3057\u307e\u3059\u3002(y\u5ea7\u6a19\u306e\u6307\u5b9a\u306b\u6709\u52b9)<\/li>\n\n\n\n<li>bottom: \u8d77\u70b9\u306ey\u5ea7\u6a19\u3092\u4e0b\u7aef(100%)\u306b\u3057\u307e\u3059\u3002(y\u5ea7\u6a19\u306e\u6307\u5b9a\u306b\u6709\u52b9)<\/li>\n\n\n\n<li>center: \u8d77\u70b9\u306ex\u3001y\u5ea7\u6a19\u3092\u4e2d\u592e(50%)\u306b\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u4efb\u610f\u306e\u5358\u4f4d: px \u3084 % \u306a\u3069\u306e\u5358\u4f4d\u3067\u6307\u5b9a\u53ef\u80fd\u3002<\/li>\n<\/ul>\n\n\n\n<p>% \u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u3001\u8981\u7d20\u306b\u5bfe\u3059\u308b\u5272\u5408\u306b\u306a\u308a\u307e\u3059\u3002px\u306e\u5834\u5408\u306f\u3001\u7d76\u5bfe\u5024\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u30b5\u30f3\u30d7\u30eb<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c7\u30d5\u30a9\u30eb\u30c8<\/h2>\n\n\n\n<p>transform-origin \u3092\u6307\u5b9a\u3057\u306a\u3044\u5834\u5408\u3001\u8d77\u70b9\u306f\u8981\u7d20\u306e\u4e2d\u5fc3\u306b\u306a\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306ftransform-origin\u3092\u6307\u5b9a\u3057\u306a\u3044\u5834\u5408\u3068\u6307\u5b9a\u3059\u308b\u5834\u5408\u306e\u52d5\u304d\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>HTML<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;div class=&#39;test-box-01&#39;&gt;&lt;\/div&gt;\n&lt;div class=&#39;test-box-02&#39;&gt;&lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<p><strong>CSS<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>.test-box-01 {\n  width: 100px;\n  height: 100px;\n  background-color: aqua;\n  margin-left: 300px;\n  margin-top: 100px;\n}\n\n.test-box-01:active {\n  transform-origin:50% 50%;\n  transform: scaleX(2);\n}\n\n.test-box-02 {\n  width: 100px;\n  height: 100px;\n  background-color: aqua;\n  margin-left: 300px;\n  margin-top: 100px;\n}\n\n.test-box-02:active {\n  transform: scaleX(2);\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<p>\u3069\u3061\u3089\u3082\u8981\u7d20\u3092\u62bc\u4e0b\u3059\u308b\u3068\u4e2d\u592e\u3092\u8d77\u70b9\u3068\u3057\u8981\u7d20\u304c\u6a2a\u306b\u4f38\u3073\u307e\u3059\u3002<\/p>\n\n\n\n<style>\n.test-box-01 {\n  width: 100px;\n  height: 100px;\n  background-color: aqua;\n  margin-left: 10%;\n  margin-top: 10%;\n}\n\n.test-box-01:active {\n  transform-origin:50% 50%;\n  transform: scaleX(2);\n}\n\n.test-box-02 {\n  width: 100px;\n  height: 100px;\n  background-color: aqua;\n  margin-left: 10%;\n  margin-top: 10%;\n}\n\n.test-box-02:active {\n  transform: scaleX(2);\n}\n\n<\/style>\n<div style='height:100%'>\n<div class='test-box-01'><\/div>\n<div class='test-box-02'><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">X\u65b9\u5411<\/h2>\n\n\n\n<p>X\u65b9\u5411\u306b\u52d5\u304f\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>HTML<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;div class=&#39;test-box-03&#39;&gt;&lt;\/div&gt;\n&lt;div class=&#39;test-box-04&#39;&gt;&lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<p><strong>CSS<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>.test-box-03 {\n  width: 100px;\n  height: 100px;\n  background-color: aqua;\n  margin-left: 300px;\n  margin-top: 100px;\n}\n\n.test-box-03:active {\n  transform-origin: 0px;\n  transform: scaleX(2);\n}\n\n.test-box-04 {\n  width: 100px;\n  height: 100px;\n  background-color: aqua;\n  margin-left: 300px;\n  margin-top: 100px;\n}\n\n.test-box-04:active {\n  transform-origin: 20px;\n  transform: scaleX(2);\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<p>\u4e00\u3064\u76ee\u306f\u3001\u8d77\u70b9\u306ex\u5ea7\u6a19\u30920px\u306b\u6307\u5b9a\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u5de6\u7aef\u304b\u3089\u53f3\u3078\u4f38\u3073\u307e\u3059\u3002<br>\u4e00\u3064\u76ee\u306f\u3001\u8d77\u70b9\u306ex\u5ea7\u6a19\u309220px\u306b\u6307\u5b9a\u3057\u3066\u3044\u308b\u306e\u3067\u300120px\u53f3\u3092\u8d77\u70b9\u3068\u3057\u3066\u5de6\u53f3\u3078\u4f38\u3073\u307e\u3059\u3002<\/p>\n\n\n\n<style>\n.test-box-03 {\n  width: 100px;\n  height: 100px;\n  background-color: aqua;\n  margin-left: 300px;\n  margin-top: 100px;\n}\n\n.test-box-03:active {\n  transform-origin: 0px;\n  transform: scaleX(2);\n}\n\n.test-box-04 {\n  width: 100px;\n  height: 100px;\n  background-color: aqua;\n  margin-left: 300px;\n  margin-top: 100px;\n}\n\n.test-box-04:active {\n  transform-origin: 20px;\n  transform: scaleX(2);\n}\n<\/style>\n<div style='height:100%'>\n<div class='test-box-03'><\/div>\n<div class='test-box-04'><\/div>\n<\/div>\n\n\n\n<h1 class=\"wp-block-heading\">\u6700\u5f8c\u306b<\/h1>\n\n\n\n<p>\u7279\u306b\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>transform-origin \u306f\u5909\u5f62\u3055\u305b\u308b\u8981\u7d20\u306e\u8d77\u70b9\u5ea7\u6a19\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":4723,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-4800","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css"],"_links":{"self":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/4800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4800"}],"version-history":[{"count":17,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/4800\/revisions"}],"predecessor-version":[{"id":5124,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/4800\/revisions\/5124"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/media\/4723"}],"wp:attachment":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}