I have written below code. But now the requirement is that the image should be rotated 180 degrees. How can I achieve this?
#cell { background-image: url("../images/logo.PNG"); background-attachment: fixed; background-repeat: no-repeat; background-position: 0px 250px; background-color: #FFFFFF; border-left: 2px; }
HTML tag:
<td width="2%" id="cell"/>
We can add the following to a particular tag in CSS: -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); In case of half rotation change 90 to 45 .
Syntax: transform: rotate(90deg);
One cross-browser solution is
#cell { -webkit-transform: rotate(180deg); /* Chrome and other webkit browsers */ -moz-transform: rotate(180deg); /* FF */ -o-transform: rotate(180deg); /* Opera */ -ms-transform: rotate(180deg); /* IE9 */ transform: rotate(180deg); /* W3C compliant browsers */ /* IE8 and below */ filter: progid:DXImageTransform.Microsoft.Matrix(M11=-1, M12=0, M21=0, M22=-1, DX=0, DY=0, SizingMethod='auto expand'); }
Note, that for IE8 and below, the rotation center point is not located in the center of the image (as it happens with all other browsers). So, for IE8 and below, you need to play with negative margins (or paddings) to shift the image up and left.
The element needs to be blocked. Other units that can be used are: 180deg
= .5turn
= 3.14159rad
= 200grad
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With