HTML | DOM Style transformOrigin Property Last Updated : 07 Jun, 2022 Comments Improve Suggest changes 4 Likes Like Report Every HTML element has some position on the screen. This position is described using co-ordinate geometry using x-axis and y-axis. The HTML DOM Style transformOrigin Property used to change the position of an HTML div. It helps in both 2D and 3D transformation.Syntax: To set the transformOrigin property: object.style.transformOrigin="x-value y-value" To return the transformOrigin property: object.style.transformOriginReturn Values: It returns a string value that represents the transform-origin property of an elementx-axis: Placed value of x-axis.y-axis: Placed value of y-axis.z-axis: placed value of z-axis in 3D.initial: Set default value of element.inherit: Inherit from its parent element Example: Transform the origin of circle 2. html <!DOCTYPE html> <html> <head> <title> HTML | DOM Style transformOrigin Property </title> <script> //the following script will find element // whose id is circle2 and transform //it's position to origin function myFunction() { document.getElementById( "circle2").style.transformOrigin = "0 0"; } </script> <style> #circle1 { height: 150px; width: 150px; margin: auto; border: 1px solid black; border-radius: 50%; } #circle2 { width: 150px; height: 150px; border: 1px solid black; background-color: #0f9d58; transform: rotate(45deg); border-radius: 50%; } #circle3 { position: absolute; width: 150px; height: 150px; border: #0f9d58; background-color: #0f9d58; opacity: 0.5; border-radius: 50%; } </style> </head> <body> <button onclick="myFunction()"> Submit </button> <div id="circle1"> <div id="circle2"></div> <div id="circle3"></div> </div> </body> </html> Output Before clicking on button: After clicking on button Note: For safari used "WebkitTransformOrigin" instead of "transformOrigin".Supported Browsers: The browsers supported by HTML | DOM Style transformOrigin Property are listed below: Google ChromeEdgeFirefoxOpera Create Quiz Comment S Shahnawaz_Ali Follow 4 Improve S Shahnawaz_Ali Follow 4 Improve Article Tags : Web Technologies HTML HTML-DOM Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms4 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List5 min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like