HTML DOM Style perspectiveOrigin Property
-- Learning is not just about technology, but also about dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
JavaScript Reference
JavaScript Objects
- JavaScript Array Object
- JavaScript Boolean Object
- JavaScript Date Object
- JavaScript Math Object
- JavaScript Number Object
- JavaScript String Object
- JavaScript RegExp Object
- JavaScript Global Properties/Functions
- JavaScript Operators
- JavaScript Error
Browser Objects
DOM Objects
- HTML DOM Document Object
- HTML DOM Element Object
- HTML DOM Attribute Object
- HTML DOM Event Object
- HTML DOM Console Object
- CSSStyleDeclaration Object
- DOM HTMLCollection
HTML Objects
- <a>
- <area>
- <audio>
- <base>
- <blockquote>
- <body>
- <button>
- <canvas>
- <col>
- <colgroup>
- <datalist>
- <del>
- <details>
- <dialog>
- <embed>
- <fieldset>
- <form>
- <iframe>
- <frameset >
- <img>
- <ins>
- <input> - button
- <input> - checkbox
- <input> - color
- <input> - date
- <input> - datetime
- <input> - datetime-local
- <input> - email
- <input> - file
- <input> - hidden
- <input> - image
- <input> - month
- <input> - number
- <input> - range
- <input> - password
- <input> - radio
- <input> - reset
- <input> - search
- <input> - submit
- <input> - text
- <input> - time
- <input> - url
- <input> - week
- <keygen>
- <link>
- <label>
- <legend>
- <li>
- <map>
- <menu>
- <menuItem>
- <meta>
- <meter>
- <object>
- <ol>
- <optgroup>
- <option>
- <param>
- <progress>
- <q>
- <script>
- <select>
- <source>
- <style>
- <table>
- <td>
- <th>
- <tr>
- <textarea>
- <title>
- <time>
- <track>
- <video>
Style perspectiveOrigin Property
Example
Set the base point position of a 3D element:
document.getElementById("myDIV").style.perspectiveOrigin="10px 50%";
Definition and Usage
The perspectiveOrigin property defines the position of a 3D element based on the X-axis and Y-axis. This property allows you to change the bottom position of a 3D element.
When the perspectiveOrigin property is defined for an element, its child elements get the perspective effect, not the element itself.
Note: Use this property together with the perspective property, and it only affects 3D transformed elements!
Browser Support
IE10+ and Firefox support the perspectiveOrigin property.
Chrome, Safari, and Opera support an alternative property, the WebkitPerspecitveOrigin property.
Syntax
Return the perspectiveOrigin property:
object.style.perspectiveOrigin
Set the perspectiveOrigin property:
object.style.perspectiveOrigin="x-axis y-axis|initial|inherit"
Property Values
| Value | Description |
|---|---|
| x-axis | Defines the position of the view on the x-axis. Possible values:
|
| y-axis | Defines the position of the view on the y-axis. Possible values:
|
| initial | Sets this property to its default value. See initial. |
| inherit | Inherits this property from its parent element. See inherit. |
Technical Details
| Default Value: | 50% 50% |
|---|---|
| Return Value: | A string, representing the element's perspective-origin property. |
| CSS Version: | CSS3 |
Related Articles
JavaScript Style Object: perspective Property
CSS Reference: perspective-origin Property
YouTip