burger menu icon
WillMaster

WillMaster > LibraryWeb Content Preparation

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Rotate

The CSS rotate property is versatile, more versatile than the transform:rotate() function.

Although versatile, the rotate examples in this article are simple.

Toward the end of the article are a few hints about its versatility. For a deeper immersion into the CSS rotate property, see the Mozilla rotate reference.

Simple? Yes, very much so.

Let's suppose you want to rotate a paragraph 3 degrees toward the right. Use rotate:3deg for this effect:

This paragraph is rotated 3 degrees to the right. (For visual comprehension, this is added to wrap the line even in large desktop browser windows.)

Here is the source code for the above example.

<p style="rotate:3deg;">
This paragraph is rotated 3 degrees to the right. (For visual comprehension, this is added to wrap the line even in large desktop browser windows.)
</p>

Let's do the same amount of rotation but toward the left. Use rotate:-3deg for the effect:

This paragraph is rotated 3 degrees to the left. (For visual comprehension, this is added to wrap the line even in large desktop browser windows.)

Here is the source code for the above example.

<p style="rotate:-3deg;">
This paragraph is rotated 3 degrees to the left. (For visual comprehension, this is added to wrap the line even in large desktop browser windows.)
</p>

That's it. That's the simplicity. Use the CSS rotate property on HTML content blocks. Block tags p, div, td, and img are examples.

Versatility

The amount of rotation can be specified as deg, turn, or rad. Only deg is used in the examples. The link a couple short paragraphs down talks about each of those.

The rotation axis may be specified as x, y or z. The default is z, as you see in the above examples.

A representation of 3D rotation can also be specified.

See the Mozilla rotate reference page for coding the versatility.

The default axis, as demonstrated in the examples above, is the easy-peasy aspect of using the rotate property. It is what I use the most. For those who need more, the more versatile aspects are available.

(This content first appeared in Possibilities newsletter.)

Will Bontrager

Was this article helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method

All information in WillMaster Library articles is presented AS-IS.

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2026 Will Bontrager Software LLC