• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

Css Basic: transform-origin

December 20, 2023

CSS Basics: transform-origin

CSS (Cascading Style Sheets) is a powerful tool that allows web developers to control the visual appearance of their websites. One of the key features of CSS is the ability to transform elements, such as scaling, rotating, skewing, and translating them. In this article, we will explore the transform-origin property, which determines the origin point of these transformations.

Understanding transform-origin

The transform-origin property defines the point around which an element is transformed. By default, the transform-origin is set to the center of the element. However, you can change this origin point to achieve different effects.

The property takes three values: horizontal position, vertical position, and depth position. The horizontal and vertical positions can be defined using keywords like “top,” “bottom,” “left,” “right,” or using length values like pixels or percentages. The depth position is defined using a length value.

For example, if you want to rotate an element around its top-left corner, you can set the transform-origin property to “left top.” Similarly, if you want to scale an element from its bottom-right corner, you can set the transform-origin property to “right bottom.”

Examples

Let’s take a look at some examples to better understand how the transform-origin property works.

.box {
  width: 200px;
  height: 200px;
  background-color: #f1f1f1;
  transform: rotate(45deg);
  transform-origin: center;
}

In this example, the transform-origin is set to “center,” which is the default value. The element will be rotated around its center point.

.box {
  width: 200px;
  height: 200px;
  background-color: #f1f1f1;
  transform: rotate(45deg);
  transform-origin: left top;
}

In this example, the transform-origin is set to “left top.” The element will be rotated around its top-left corner.

Conclusion

The transform-origin property is a powerful tool in CSS that allows web developers to control the origin point of transformations. By changing the transform-origin, you can achieve different effects and create visually appealing websites.

Summary

In conclusion, the transform-origin property in CSS determines the origin point of transformations. By default, the origin is set to the center of the element. However, you can change it using keywords or length values. Understanding and utilizing the transform-origin property can help you create visually stunning websites.

For more information on VPS hosting services, visit Server.HK.

Recent Posts

  • How to Deploy a Node.js Application on Hong Kong VPS: Complete Guide
  • How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)
  • How to Choose the Right Hong Kong VPS Plan: A Buyer’s Guide for 2026
  • CN2 GIA vs BGP vs CN2 GT: What’s the Real Difference for China Connectivity?
  • Top 5 Use Cases for a Hong Kong Dedicated Server in 2026

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot