Rotating an image on a web page is possible using a CSS rotate class, which is added to any tag to rotate the image.

Rotating an image using CSS

The CSS code needs to include transformations code for each major Internet browser, so the image is rotated in all browsers.

Below is an example of CSS code to rotate an image 180-degrees.

.rotateimg180 { -webkit-transform:rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); }

The CSS code above should be added to a .css stylesheet file linked in your HTML. For example, if your CSS file is named site.css and in the same directory as your HTML file, you can include the following HTML in theelement:

Alternatively, you can include the CSS code inline, either in a style tag appearing before the image tag, or in the style attribute of the image tag.

Once the CSS code is applied to your .css file, stylesheet, or