CARVIEW |
Select Language
HTTP/2 200
content-type: text/html
x-guploader-uploadid: AAwnv3L8VH_1u2BXvvLOPcE9iv_0g1yRyEiDbMoFN6ogNYOTk4wX3QBFHhzn6ithC8FW1j-L
cache-control: public, max-age=3600
expires: Thu, 09 Oct 2025 18:23:48 GMT
last-modified: Thu, 09 Oct 2025 01:14:02 GMT
etag: W/"5a0fee1be6498500702c796fcd1ecef4"
x-goog-generation: 1759972442208830
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 284762
x-goog-meta-goog-reserved-file-mtime: 1759970323
x-goog-hash: crc32c=8LMKKw==, md5=Wg/uG+ZJhQBwLHlvzR7O9A==
x-goog-storage-class: STANDARD
accept-ranges: none
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
alt-svc: clear
referrer-policy: strict-origin-when-cross-origin
x-content-type-options: nosniff
strict-transport-security: max-age=63072000
content-security-policy: default-src 'self'; script-src 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; script-src-elem 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; style-src 'report-sample' 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; connect-src 'self' developer.allizom.org bcd.developer.allizom.org bcd.developer.mozilla.org updates.developer.allizom.org updates.developer.mozilla.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://incoming.telemetry.mozilla.org https://observatory-api.mdn.allizom.net https://observatory-api.mdn.mozilla.net https://api.github.com/search/issues stats.g.doubleclick.net https://api.stripe.com; font-src 'self'; frame-src 'self' interactive-examples.mdn.mozilla.net interactive-examples.mdn.allizom.net mdn.github.io live-samples.mdn.mozilla.net live-samples.mdn.allizom.net *.mdnplay.dev *.mdnyalp.dev *.play.test.mdn.allizom.net https://v2.scrimba.com https://scrimba.com jsfiddle.net www.youtube-nocookie.com codepen.io survey.alchemer.com https://js.stripe.com; img-src 'self' data: *.githubusercontent.com *.googleusercontent.com *.gravatar.com mozillausercontent.com firefoxusercontent.com profile.stage.mozaws.net profile.accounts.firefox.com developer.mozilla.org mdn.dev interactive-examples.mdn.mozilla.net interactive-examples.mdn.allizom.net wikipedia.org upload.wikimedia.org https://mdn.github.io/shared-assets/ https://mdn.dev/ https://*.google-analytics.com https://*.googletagmanager.com www.gstatic.com; manifest-src 'self'; media-src 'self' archive.org videos.cdn.mozilla.net https://mdn.github.io/shared-assets/; child-src 'self'; worker-src 'self';
x-frame-options: DENY
origin-trial: AxVILwizhbMjxFeHOn1P3R8niO1RJY/smaK4B4d1rLzc1gTaxtXMSaTi+FoigYgCw40uFRDwFcEAeqDR+vVLOW4AAABfeyJvcmlnaW4iOiJodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZyIsImZlYXR1cmUiOiJQcml2YXRlQXR0cmlidXRpb25WMiIsImV4cGlyeSI6MTc0MjA3OTYwMH0=
x-cloud-trace-context: 785a385d3eaea92241dd18b20c275a62
date: Thu, 09 Oct 2025 17:23:48 GMT
server: Google Frontend
via: 1.1 google
vary: Accept-Encoding
content-encoding: gzip
x-cache: miss
perspective-origin - CSS: カスケーディングスタイルシート | MDN
Toggle sidebar
>
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
perspective-origin
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年9月.
perspective-origin
は CSS のプロパティで、閲覧者の視点の位置を決めます。これは perspective
プロパティによって消点として使われます。
試してみましょう
perspective-origin: center;
perspective-origin: top;
perspective-origin: bottom right;
perspective-origin: -170%;
perspective-origin: 500% 200%;
<section class="default-example" id="default-example">
<div class="transition-all" id="example-element">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</section>
#default-example {
background: linear-gradient(skyblue, khaki);
perspective: 550px;
}
#example-element {
width: 100px;
height: 100px;
transform-style: preserve-3d;
perspective: 250px;
}
.face {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
position: absolute;
backface-visibility: inherit;
font-size: 60px;
color: white;
}
.front {
background: rgba(90, 90, 90, 0.7);
transform: translateZ(50px);
}
.back {
background: rgba(0, 210, 0, 0.7);
transform: rotateY(180deg) translateZ(50px);
}
.right {
background: rgba(210, 0, 0, 0.7);
transform: rotateY(90deg) translateZ(50px);
}
.left {
background: rgba(0, 0, 210, 0.7);
transform: rotateY(-90deg) translateZ(50px);
}
.top {
background: rgba(210, 210, 0, 0.7);
transform: rotateX(90deg) translateZ(50px);
}
.bottom {
background: rgba(210, 0, 210, 0.7);
transform: rotateX(-90deg) translateZ(50px);
}
perspective-origin
および perspective
の各プロパティは、三次元空間で座標変換される子の親に設定するものであり、座標変換される要素に設定される perspective()
変換関数とは異なります。
構文
css
/* 1 値構文 */
perspective-origin: x-position;
/* 2 値構文 */
perspective-origin: x-position y-position;
/* x-position と y-position がキーワードである場合は、
以下の構文も有効 */
perspective-origin: y-position x-position;
/* グローバル値 */
perspective-origin: inherit;
perspective-origin: initial;
perspective-origin: revert;
perspective-origin: revert-layer;
perspective-origin: unset;
値
- x-position
-
消失点の横座標上の位置を示します。次のいずれかの値です。
<length-percentage>
は、絶対的な length 値、または要素の幅に対する相対値で位置を示します。負の数も使えます。left
キーワードは、length 値0
を示すショートカットです。center
キーワードは、パーセント値50%
を示すショートカットです。right
キーワードは、パーセント値100%
を示すショートカットです。
- y-position
-
消失点の縦座標上の位置を示します。次のいずれかの値です。
<length-percentage>
は、絶対的な length 値、または要素の高さに対する相対値で位置を示します。負の数も使えます。top
キーワードは、 length 値0
を示すショートカットです。center
キーワードは、パーセント値50%
を示すショートカットです。bottom
キーワードは、パーセント値100%
を示すキーワードです。
公式定義
初期値 | 50% 50% |
---|---|
適用対象 | 座標変換可能要素 |
継承 | なし |
パーセント値 | 囲みボックスの寸法に対する相対値 |
計算値 | <length> の場合は絶対的な値、それ以外の場合はパーセント値 |
アニメーションの種類 | 長さ、パーセント値、 calc の単純なリスト |
形式文法
perspective-origin =
<position>
<position> =
[ left | center | right | top | bottom | <length-percentage> ] |
[ left | center | right ] && [ top | center | bottom ] |
[ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] |
[ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ]
<length-percentage> =
<length> |
<percentage>
例
>視点の原点の変更
perspective-origin
の変更方法を示す例は、 CSS 座標変換の使用 > 視点の変更にあります。
仕様書
Specification |
---|
CSS Transforms Module Level 2> # perspective-origin-property> |
ブラウザーの互換性
Loading…