How can I flip an element 180degrees with CSS? - css

I don't want to rotate it - it's not 1998!
Can I purely flip this element when the is-expanded class is added?
.resources__icon {
#include icon('arrow-down-white', 28, 18);
}
.is-expanded.resources__icon {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-o-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}

ScaleY can flip an image, not just "change the scale" - use scaleY instead of rotate
.resources__icon {
#include icon('arrow-down-white', 28, 18);
}
.is-expanded.resources__icon {
-moz-transform: scaleY(-1);
-o-transform: scaleY(-1);
-webkit-transform: scaleY(-1);
transform: scaleY(-1);
}

Try it: Replace translate to rotate please!
.rotate{
transform:rotate(180deg);
-webkit-transform:rotate(180deg);
-moz-transform: rotate(180deg);
-o-transform: rotate(180deg);
-ms-transform: rotate(180deg);
}
1. None rotate
<br>
<img src="http://hocwebchuan.com/reference/tag/images/img_sakura.jpg" width="100">
<br>
2. Rotate
<br>
<img class="rotate" src="http://hocwebchuan.com/reference/tag/images/img_sakura.jpg" width="100">

Related

I want to turn the back of my credit card. Not with Focus

I have a credit card component. It works when there is a hover effect, but does not work in the focus part (CCV) of the corresponding Input. How can I do it?
Component Full Codes:
https://codepen.io/veronicadev/pen/VXqZgR (not my codes)
HTML Element
<input-mask id="special-cvc-input" v-model="cardCvc" type="text" mask="999"></input-mask>
Working Hover CSS Codes
.card:hover .card__front {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
}
.card:hover .card__back {
-webkit-transform: rotateY(0deg);
-moz-transform: rotateY(0deg);
}
Not Working Focus CSS Codes
#special-cvc-input:focus .card_front{
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
}
#special-cvc-input:focus .card__back{
-webkit-transform: rotateY(0deg);
-moz-transform: rotateY(0deg);
}
Change
.card:hover .card__front
on
#special-cvc-input:focus + .card .card__back

Why $rotation variable in scss not parse in filter: progid:DXImageTransform.Microsoft.BasicImage

Compiled css
.fa-rotate-90 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation);
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg); }
SCSS
$fa-css-prefix : 'fa';
#mixin fa-icon-rotate($degrees, $rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation);
-webkit-transform: rotate($degrees);
-moz-transform: rotate($degrees);
-ms-transform: rotate($degrees);
-o-transform: rotate($degrees);
transform: rotate($degrees);
}
.#{$fa-css-prefix}-rotate-90 { #include fa-icon-rotate(90deg, 1); }
Why I got unexpected result filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation);
Can anyone please point out what mistake in this scss.
As I had mentioned earlier in comments, for this case we need to make use of interpolation like in the below code block to get the value of the $rotation variable printed. The syntax for interpolation is #{$var}. Interpolation is required because the variable's value needs to be placed within another string and then the whole thing needs to be assigned as the value to a property.
$fa-css-prefix : 'fa';
#mixin fa-icon-rotate($degrees, $rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
-webkit-transform: rotate($degrees);
-moz-transform: rotate($degrees);
-ms-transform: rotate($degrees);
-o-transform: rotate($degrees);
transform: rotate($degrees);
}
.#{$fa-css-prefix}-rotate-90 { #include fa-icon-rotate(90deg, 1); }

How to do a custom border shape with CSS3

I'm just wondering if this shape I have in the image url is doable in css3 with webkit.
Here is a good source for CSS shapes
Just edit the class properties to your liking to get desired shape
CSS:
.parallelogramRight {
width:100px;
height:100px;
border:1px solid #000;
background:yellow;
transform: skew(-20deg);
-o-transform: skew(-20deg);
-moz-transform: skew(-20deg);
-webkit-transform: skew(-20deg);
}
You can use the transform: skew() property.
http://codepen.io/anon/pen/tkdyx
Yes it is.
-moz-transform: skewX(-23deg);
-webkit-transform: skewX(-23deg);
-o-transform: skewX(-23deg);
-ms-transform: skewX(-23deg);
transform: skewX(-23deg);

After rotation a box the box is different. (css transform preserve-3d rotate)

I'am trying to rotate a box with text like a slot-machine. I use pure css.
I think it works so far but i do have a problem that the rotated-box is smaller after rotation.
Here is my code:
jsfiddle
The main-code is done here:
#category_wrapper.show-unten{
-webkit-transform: translateZ(-5px) rotateX(90deg);
-moz-transform: translateZ(-75px) rotateX(90deg);
-ms-transform: translateZ(-75px) rotateX(90deg);
-o-transform: translateZ(-75px) rotateX(90deg);
transform: translateZ(-75px) rotateX(90deg);
}
Is this a bug or do I something wrong?
only use this:
#category_wrapper.show-unten{
-webkit-transform: translateZ(-5px) rotateX(90deg);
-moz-transform: translateZ(-75px) rotateX(90deg);
-ms-transform: translateZ(-75px) rotateX(90deg);
-o-transform: translateZ(-75px) rotateX(90deg);
transform: translateZ(0px) rotateX(90deg);
}
the changes at last line see==> transform: translateZ(0px) rotateX(90deg);
and use this:
transform: rotateX(-100deg) translateZ(75px); //instead of -90 deg in class .unten
i updated your jsfiddle =>Jsfiddle

Adding More Slant To Italic Text

I was curious as to if you can impact italic text with more of a slant with CSS? If so, how can this be accomplished?
You can simulate a custom slant with CSS3 skew transformations (although it will not look as great as a real italic font).
Here's an example:
HTML:
<p class="slant">Some text</p>
CSS
.slant {
-moz-transform: scale(1) rotate(0deg) translate(0px, 0px) skew(30deg, 0deg);
-webkit-transform: scale(1) rotate(0deg) translate(0px, 0px) skew(30deg, 0deg);
-o-transform: scale(1) rotate(0deg) translate(0px, 0px) skew(30deg, 0deg);
-ms-transform: scale(1) rotate(0deg) translate(0px, 0px) skew(30deg, 0deg);
transform: scale(1) rotate(0deg) translate(0px, 0px) skew(30deg, 0deg);
}
You can also use
font-style: oblique 50deg;
(you can change 50 to what angle you want)
With standard font-style in CSS, it is not possible to customise the italic state.
This is up to the browsers own preference and the fonts italic state.

Resources