perspective プロパティ用の原点を確立する。
| 名前 | perspective-origin
|
|---|---|
| 値 | <position> |
| 初期値 | 50% 50% |
| 適用対象 | 変形可能な要素 |
| 継承 | されない |
| 百分率 | 基準ボックスのサイズに相対的 |
| 算出値 | background-position を見よ |
| 正準的順序 | 文法に従う |
| アニメーション型 | 算出された値型による |
[perspective/perspective-origin]プロパティの値は、上述に従って透視行列の算出に利用される。
perspective-origin に対する値は、遠近法の原点の、基準ボックスの左上隅からのオフセットを表現する。
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:left top;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:left bottom;
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:left 30%;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:left 30%;
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:left 30% top 90%;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:left 30% top 90%;
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:50px;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:50px;
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:90px;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:90px;
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:170px;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:170px;
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:30%;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:30%;
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:100%;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:100%;
top、right、bottom、left
他の場合、これらのキーワードは、上に挙げられた順に[縦位置に対する 0%、横位置に対する 100%、縦位置に対する 100%、横位置に対する 0%、]に算出される。
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:top;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:top;
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:right;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:right;
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:bottom;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:bottom;
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:left;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:left;
center
<DIV style="border:1px solid black;
width:200px; height:100px;
margin-top:75px;
">
<DIV style="border:1px solid red;
width:100%; height:100%;
backface-visibility:visible;
transform-style:preserve-3d;
perspective:300px;
perspective-origin:center;
">
<DIV style="border:1px solid black;
width:100px; height:100px;
font-family:Arial;
font-size: 60px; line-height:100px;
color:white; background:#f003;
text-align:center;
transform:rotateY(90deg) translateZ(50px) translateX(-50px);
">3</DIV>
</DIV>
</DIV>
perspective-origin:center;
perspective-origin の解決値は、height の様に特別 とする。[CSSOM]
| 表示内容: |
| 表示内容: |