mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add Change The Orientation Of An Image as a css til
This commit is contained in:
@@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket.
|
|||||||
|
|
||||||
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
|
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
|
||||||
|
|
||||||
_880 TILs and counting..._
|
_881 TILs and counting..._
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -96,6 +96,7 @@ _880 TILs and counting..._
|
|||||||
- [Animate Smoothly Between Two Background Colors](css/animate-smoothly-between-two-background-colors.md)
|
- [Animate Smoothly Between Two Background Colors](css/animate-smoothly-between-two-background-colors.md)
|
||||||
- [Apply Multiple Box Shadows To Single Element](css/apply-multiple-box-shadows-to-single-element.md)
|
- [Apply Multiple Box Shadows To Single Element](css/apply-multiple-box-shadows-to-single-element.md)
|
||||||
- [Apply Styles To The Last Child Of A Specific Type](css/apply-styles-to-the-last-child-of-a-specific-type.md)
|
- [Apply Styles To The Last Child Of A Specific Type](css/apply-styles-to-the-last-child-of-a-specific-type.md)
|
||||||
|
- [Change The Orientation Of An Image](css/change-the-orientation-of-an-image.md)
|
||||||
- [Circular Icons With A Massive Border Radius](css/circular-icons-with-a-massive-border-radius.md)
|
- [Circular Icons With A Massive Border Radius](css/circular-icons-with-a-massive-border-radius.md)
|
||||||
- [Create A Pulsing Background With CSS Animation](css/create-a-pulsing-background-with-css-animation.md)
|
- [Create A Pulsing Background With CSS Animation](css/create-a-pulsing-background-with-css-animation.md)
|
||||||
- [Dry Up SCSS With Mixins](css/dry-up-scss-with-mixins.md)
|
- [Dry Up SCSS With Mixins](css/dry-up-scss-with-mixins.md)
|
||||||
|
|||||||
18
css/change-the-orientation-of-an-image.md
Normal file
18
css/change-the-orientation-of-an-image.md
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Change The Orientation Of An Image
|
||||||
|
|
||||||
|
A single-line CSS transform is all it takes to change the orientation of an
|
||||||
|
image (or any DOM element, really).
|
||||||
|
|
||||||
|
For instance, if I have an image that is _on its side_, I can use the following
|
||||||
|
[`rotate`
|
||||||
|
transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate)
|
||||||
|
to orient it correctly.
|
||||||
|
|
||||||
|
```css
|
||||||
|
img {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
It takes an angle which can be specified in degrees. Here I use `90deg`. If I
|
||||||
|
was going for a different effect, I could do something like `45deg`.
|
||||||
Reference in New Issue
Block a user