Are You Mentally Fit?

Our resilience is often tested when life circumstances take an unexpected turn. Everyone possesses some degree of mental strength, however, we all react differently when life knocks us down. In some…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




CSS Transform property for beginners

Through CSS transform we change the element shape , size and position and that’s it. with the help of transform we can zoom-in, zoom-out, rotate, skew and translate our component.

It has four property that control how element will be displayed and those properties are:

transform:scaleX(+ve value for increase width and vice versa).

transform:scaleY(+ve value for increase height and vice versa).

transform:scale(both dirction).

transform: translateX(+ve value push forward horizontally and vice versa).

transform: translateY(+ve value push downward vertically and vice versa).

transform: translate(X ,Y).

transform:rotateY(+value rotate clcok wise and vice versa).

transform:rotateX(value).

As you see in above example rotate in X-direction shrink the height of span. If we rotate in Y-direction it shrink the width. It did not work as we think. if you want a real 3D- effect. you have to use a property called Perpective in the parent element.

What is perspective??

Perspective is like a distance between our eyes to screen.In order to work in 3d environment, you need to define perspective first .It sound like a weird but it doesn’t.

Let’s see one simple example how perspective work.

1 complete rotation= 360 degree.

400 gradient= 360 degree.

200 gradient= 180 degree.

example:transform:rotate(200 grad or 180 deg)

or 1 turn= 360 degree

transform-origin is a point that a transform take as a reference when it works. Simply a point where transform applied first. By default transform starts from center, but you can change origin of your transform.

transform-origion:left ,right, top ,bootom ,center. example-

If you don’t want these properties your starting point, you can set origin like

Add a comment

Related posts:

How to Choose your Mattress Thickness?

While choosing a mattress for tranquil comfort, deciding the thickness is an integral part of the process. The thickness of the mattress is directly related to your comfort level, if you choose a…

The Sales Pipeline Challenge

Pipeline management and forecasting are both important to a sales force. Consequently, companies invest heavily in specialized technology and tools just to manage these two activities; these might…

the Harmony

The life we live is created by ourselves. It’s us that make the meaning and flow with. For some people is a basic principle of taking care of each other, to others a set of values to be guided and…