{"id":14814,"date":"2020-04-17T13:45:50","date_gmt":"2020-04-17T20:45:50","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=14814"},"modified":"2023-12-01T02:41:22","modified_gmt":"2023-12-01T10:41:22","slug":"css-2d-transforms","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/","title":{"rendered":"CSS 2D Transforms"},"content":{"rendered":"\n<p>Creating animated web elements is an important feature of web design. For instance, you may be designing a button that you want to skew when the user hovers over the button.<br><\/p>\n\n\n\n<p>That\u2019s where the CSS transform property comes in. The transform property is used to move, rotate, skew, and scale elements on a web page. This allows you to make a web page more interactive for the user.<br><\/p>\n\n\n\n<p>This tutorial will discuss, with examples, how to work with 2D transforms in CSS using the transform property. At the end of reading this tutorial, you\u2019ll be an expert at using CSS 2D transforms.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CSS 2D Transforms<\/h2>\n\n\n\n<p>The CSS transform function allows you to create basic transform animations such as rotations, movements, scales, and skews on a web page.<br><\/p>\n\n\n\n<p>When an element is transformed, it does not affect any nearby elements. However, a transformed element can overlap them, although it will still take up the space in its default location on a web page.<br><\/p>\n\n\n\n<p>There are two types of transforms in CSS: 2D and 3D. The transform property is used to create transformations of both types, but for this article we are going to focus on 2D transforms.<br><\/p>\n\n\n\n<p>There are a number of 2D transformations which can be applied to web elements in CSS. These are:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>translate()<\/li>\n\n\n\n<li>scale()<\/li>\n\n\n\n<li>scaleX()<\/li>\n\n\n\n<li>scaleY()<\/li>\n\n\n\n<li>skew()<\/li>\n\n\n\n<li>skewX()<\/li>\n\n\n\n<li>skewY()<\/li>\n\n\n\n<li>matrix()<\/li>\n\n\n\n<li>rotate()<\/li>\n<\/ul>\n\n\n\n<p>Let\u2019s break down each of these transformations individually, with reference to an example.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">translate() Transformation<\/h2>\n\n\n\n<p>The translate() method is used to move an element from its current position to a new position on the screen.<br><\/p>\n\n\n\n<p>The translate() function accepts two parameters: the number of pixels to the right the element should move, and the number of pixels down the element should move.<br><\/p>\n\n\n\n<p>The syntax for this method is:<br><\/p>\n\n\n\n<p><code>translate(xAxis, yAxis);<br><\/code><\/p>\n\n\n\n<p>Suppose we have a box that we want to move 25px to the right and 50px down from its current position. We could accomplish this task using the following code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>index.html\n&lt;body&gt;\n\t&lt;p&gt;This is a paragraph of text.&lt;\/p&gt;\n&lt;div&gt;&lt;p&gt;This is a box that has been moved using the translate() method.&lt;\/p&gt;&lt;\/div&gt;\n&lt;\/body&gt;\nstyles.css\ndiv {\n\ttransform: translate(25px, 50px);\n\tbackground-color: lightblue;\n\tborder: 3px solid black;\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p><code>[Result of code here]<br><\/code><\/p>\n\n\n\n<p>Let\u2019s break down our code. In our HTML code, we have created two paragraphs of text. The first paragraph appears at the top of the page. The second paragraph appears below the first paragraph and is enclosed within a &lt;div&gt; tag.<br><\/p>\n\n\n\n<p>In our CSS code, we have defined a style that applies to our &lt;div&gt; tag. This style sets the color of our &lt;div&gt; to light blue, and gives our &lt;div&gt; box a 3px-wide solid black border. In addition, we have also used the translate() transformation to move our box 25px to the left and 50px down.<br><\/p>\n\n\n\n<p>Here\u2019s our code without a translate() transformation specified:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>index.html\n&lt;body&gt;\n\t&lt;p&gt;This is a paragraph of text.&lt;\/p&gt;\n&lt;div&gt;&lt;p&gt;This is a box that has been moved using the translate() method.&lt;\/p&gt;&lt;\/div&gt;\n&lt;\/body&gt;\nstyles.css\ndiv {\n\tbackground-color: lightblue;\n\tborder: 3px solid black;\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p><code>[Code result here]<br><\/code><\/p>\n\n\n\n<p>As you can see, without specifying a <code>translate() <\/code>method, our box retains its regular position on the web page.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">rotate() Transformation<\/h2>\n\n\n\n<p>The <code>rotate() <\/code>transformation allows you to rotate an element clockwise or counter-clockwise. The extent to which an item is rotated is based on a given degree value.<br><\/p>\n\n\n\n<p>The syntax for the <code>rotate()<\/code> transformation is as follows:<br><\/p>\n\n\n\n<p><code>transform: rotate(Xdeg);<br><\/code><\/p>\n\n\n\n<p>In the above syntax, X refers to the number of degrees by which you want an element to be rotated. If you want to rotate an element in the clockwise direction, you should specify a positive value for X; otherwise, if you want to rotate an element counter-clockwise, you should specify a negative value for X.<br><\/p>\n\n\n\n<p>Suppose we have a box that we want to rotate by 45 degrees. We could rotate our box using the following code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>index.html\n&lt;div&gt;&lt;p&gt;This is a box that has been rotated.&lt;\/p&gt;&lt;\/div&gt;\nstyles.css\ndiv {\n\ttransform: rotate(45deg);\n\tbackground-color: lightblue;\n\tborder: 3px solid black;\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p><code>[Code result here]<br><\/code><\/p>\n\n\n\n<p>Let\u2019s break down our code. In our HTML code, we have created a &lt;div&gt; box which holds a paragraph of text. In our CSS code, we have applied a light blue background to our box and a 3px-wide solid black border. We also rotate our &lt;div&gt; box by 45 degrees in the clockwise direction.<br><\/p>\n\n\n\n<p>As you can see in the result of our code, the box we created has been rotated. Here is a comparison of our pre-rotated and post-rotated boxes:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"179\" height=\"281\" src=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-02-at-08.40.36.jpg\" alt=\"\" class=\"wp-image-14816\" srcset=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-02-at-08.40.36.jpg 179w, https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-02-at-08.40.36-20x31.jpg 20w\" sizes=\"auto, (max-width: 179px) 100vw, 179px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">scale() Transformation<\/h2>\n\n\n\n<p>The <code>scale()<\/code> method allows you to increase or decrease the size of an element.<br><\/p>\n\n\n\n<p>The syntax for the scale() method is as follows:<br><\/p>\n\n\n\n<p><code>transform: scale(x, y);<br><\/code><\/p>\n\n\n\n<p>The scale function will proportionally scale the width (x) and height (y) of an image based on the values you specify. If you do not specify a value for the height scale, the scale() function will assume the height scale should be equal to the width scale.<br><\/p>\n\n\n\n<p>Suppose we have a box that we want to scale to 1.5x its original size. We could do so using this code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>index.html\n&lt;div&gt;&lt;p&gt;This is a box that has been scaled.&lt;\/p&gt;&lt;\/div&gt;\nstyles.css\ndiv {\n\ttransform: scale(1.5, 1.5);\n\tbackground-color: lightblue;\n\tborder: 3px solid black;\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p><code>[Code result here]<br><\/code><\/p>\n\n\n\n<p>In our HTML code, we have created a box which holds a sentence of text. In our CSS code, we have specified that all &lt;div&gt; tags should have a light blue background and a 3px-wide solid black border. We have also used the scale() method to scale up our box by a factor of 1.5x its original size.<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"249\" height=\"260\" src=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-02-at-08.37.38.jpg\" alt=\"\" class=\"wp-image-14817\" srcset=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-02-at-08.37.38.jpg 249w, https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-02-at-08.37.38-20x21-1.jpg 20w\" sizes=\"auto, (max-width: 249px) 100vw, 249px\" \/><\/figure>\n\n\n\n<p>Here is an image comparing the sizes of two boxes. The smallest box has no scale() value, and the largest box has a scale() of 1.5:<br><\/p>\n\n\n\n<p>The largest box, which includes the text <code>This is a box that has been scaled.<\/code> is 1.5x as large as our original box.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">scaleX() Transformation<\/h3>\n\n\n\n<p>The <code>scaleX()<\/code> transformation allows you to increase or decrease the width of an element. The syntax for the scaleX() transformation is:<br><\/p>\n\n\n\n<p><code>transform: scaleX(xValue);<br><\/code><\/p>\n\n\n\n<p>The xValue parameter is the amount by which you want to scale the width of an element. Suppose you have a box whose width you want to increase by a factor of 1.6. You could increase the size of this box using the following code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>index.html\n&lt;div&gt;&lt;p&gt;This is a box that has been scaled.&lt;\/p&gt;&lt;\/div&gt;\nstyles.css\ndiv {\n\ttransform: scaleX(1.5);\n\tbackground-color: lightblue;\n\tborder: 3px solid black;\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p><code>[Code result here]<br><\/code><\/p>\n\n\n\n<p>In this example, the width of our box has been increased by 1.5 times its original width.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">scaleY() Transformation<\/h3>\n\n\n\n<p>The <code>scaleY()<\/code> transformation allows you to increase or decrease the height of an element. scaleY() works in the same way as scaleX(), but instead of affecting the width of an element, scaleY() changes the height of the element.<br><\/p>\n\n\n\n<p>Suppose we wanted to reduce the height of a box to half its current height. We could do so using this code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>index.html\n&lt;div&gt;&lt;p&gt;This is a box that has been scaled.&lt;\/p&gt;&lt;\/div&gt;\nstyles.css\ndiv {\n\ttransform: scaleY(0.5);\n\tbackground-color: lightblue;\n\tborder: 3px solid black;\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p><code>[Code result here]<br><\/code><\/p>\n\n\n\n<p>In our code, we have scaled down the height of our box (which is represented by the y axis) by a factor of 0.5. In other words, our box is half of its original height.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">skew() Transformation<\/h2>\n\n\n\n<p>The <code>skew()<\/code> transformation skews an element along its x and y axis by the specified angles.<br><\/p>\n\n\n\n<p>The syntax for the skew() method is as follows:<br><\/p>\n\n\n\n<p><code>transform: skew(xValue, yValue);<br><\/code><\/p>\n\n\n\n<p>xValue refers to how much an element should be skewed on its x axis, and yValue refers to how much an element should be skewed on its y axis. Both values should be represented in degrees.<br><\/p>\n\n\n\n<p>If a value for yValue is not specified, no skew will be applied on the y axis.<br><\/p>\n\n\n\n<p>Suppose we want to skew a box by 10 degrees on its x axis and 15 degrees on its y axis. We could do so using this code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>index.html\n&lt;div&gt;&lt;p&gt;This is a box that has been skewed.&lt;\/p&gt;&lt;\/div&gt;\nstyles.css\ndiv {\n\ttransform: skew(10deg, 15deg);\n\tbackground-color: lightblue;\n\tborder: 3px solid black;\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p>In this example, we have skewed our box by 10 degrees on the x axis and 15 degrees on the y axis.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">skewX() and skewY() Transformations<\/h3>\n\n\n\n<p>Like the <code>scale()<\/code> method, <code>skew() <\/code>comes with two sub methods which are used to skew an element across either the x or y axis of an element.<br><\/p>\n\n\n\n<p>To skew an element across its X axis only, you can use the skewX() method. The syntax for this method is as follows:<br><\/p>\n\n\n\n<p><code>transform: skewX(xValue);<br><\/code><\/p>\n\n\n\n<p>xValue is the number of degrees on the x axis by which an element should be skewed.<br><\/p>\n\n\n\n<p>To skew an element across its Y axis, you can use the skewY() method. The syntax for the skewY() method is:<br><\/p>\n\n\n\n<p><code>transform: skewY(yValue);<br><\/code><\/p>\n\n\n\n<p>So, if you wanted to skew an element by 10 degrees on its Y axis, you could use this code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>div {\n\ttransform: skewY(10deg);\n}\n<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">matrix() Transformation<\/h2>\n\n\n\n<p>The<code> matrix()<\/code> transformation performs all of the 2D CSS transformations on an element. So, matrix() can be used to apply translate, rotate, scale, and skew transformations.<br><\/p>\n\n\n\n<p>The matrix() function accepts six parameters which allow you to apply transformations to an element. The syntax for this method is as follows:<br><\/p>\n\n\n\n<p>transform: matrix(scaleX(), skewY(), skewX(), scaleY(), translateX(), translateY());<br><\/p>\n\n\n\n<p>Suppose we wanted to create a box which uses the following transformations:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A scale on the X axis of 1.<\/li>\n\n\n\n<li>A skew on the Y axis of 10 degrees.<\/li>\n\n\n\n<li>A skew on the X axis of 10 degrees.<\/li>\n\n\n\n<li>A scale on the Y axis of 1.25.<\/li>\n\n\n\n<li>A movement (\u201ctranslate\u201d) on the X axis by 25px.<\/li>\n\n\n\n<li>A movement on the Y axis by 25px.<\/li>\n<\/ul>\n\n\n\n<p>We could specify each of these transformations individually. However, doing so would result in us having to write many separate transformations. Instead, we can use the matrix() method to write these transformations using one line of code.<br><\/p>\n\n\n\n<p>Here\u2019s the code we could use to create our box with the aforementioned transformations:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>index.html\n&lt;div&gt;&lt;p&gt;This is a box that has been skewed.&lt;\/p&gt;&lt;\/div&gt;\nstyles.css\ndiv {\n\ttransform: matrix(1, 10, 10, 1.25, 25, 25);\n\tbackground-color: lightblue;\n\tborder: 3px solid black;\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p><code>[Code result here]<br><\/code><\/p>\n\n\n\n<p>In our code, we applied a skew, scale, and translate transformation to our box. We accomplished this using the matrix() method and by passing the values we specified earlier.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The transform property is used to apply transformations to an element in CSS. CSS offers a number of 2D transformations, including skew, scale, rotate, and translate, which are used to transform web elements.<br><\/p>\n\n\n\n<p>This tutorial explored, with reference to examples, the basics of 2D CSS transformations. Now you\u2019re ready to start creating your own 2D transformations like a professional web developer.<\/p>\n","protected":false},"excerpt":{"rendered":"Creating animated web elements is an important feature of web design. For instance, you may be designing a button that you want to skew when the user hovers over the button. That\u2019s where the CSS transform property comes in. The transform property is used to move, rotate, skew, and scale elements on a web page.&hellip;","protected":false},"author":240,"featured_media":14815,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17287],"tags":[],"class_list":{"0":"post-14814","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-css"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"CSS","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":"","is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Tutorial will discuss how to work with 2D transforms in CSS | Career Karma<\/title>\n<meta name=\"description\" content=\"The CSS transform property is used to apply a 2D transformation to an element. On Career Karma, learn how to create 2D transforms.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CSS 2D Transforms\" \/>\n<meta property=\"og:description\" content=\"The CSS transform property is used to apply a 2D transformation to an element. On Career Karma, learn how to create 2D transforms.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-17T20:45:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T10:41:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/code-1839406_1920.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"668\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"CSS 2D Transforms\",\"datePublished\":\"2020-04-17T20:45:50+00:00\",\"dateModified\":\"2023-12-01T10:41:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/\"},\"wordCount\":1547,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/code-1839406_1920.jpg\",\"articleSection\":[\"CSS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/\",\"name\":\"Tutorial will discuss how to work with 2D transforms in CSS | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/code-1839406_1920.jpg\",\"datePublished\":\"2020-04-17T20:45:50+00:00\",\"dateModified\":\"2023-12-01T10:41:22+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"The CSS transform property is used to apply a 2D transformation to an element. On Career Karma, learn how to create 2D transforms.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/code-1839406_1920.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/code-1839406_1920.jpg\",\"width\":1000,\"height\":668},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-2d-transforms\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"CSS 2D Transforms\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/author\\\/jamesgallagher\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Tutorial will discuss how to work with 2D transforms in CSS | Career Karma","description":"The CSS transform property is used to apply a 2D transformation to an element. On Career Karma, learn how to create 2D transforms.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/","og_locale":"en_US","og_type":"article","og_title":"CSS 2D Transforms","og_description":"The CSS transform property is used to apply a 2D transformation to an element. On Career Karma, learn how to create 2D transforms.","og_url":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-04-17T20:45:50+00:00","article_modified_time":"2023-12-01T10:41:22+00:00","og_image":[{"width":1000,"height":668,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/code-1839406_1920.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"CSS 2D Transforms","datePublished":"2020-04-17T20:45:50+00:00","dateModified":"2023-12-01T10:41:22+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/"},"wordCount":1547,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/code-1839406_1920.jpg","articleSection":["CSS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/css-2d-transforms\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/","url":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/","name":"Tutorial will discuss how to work with 2D transforms in CSS | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/code-1839406_1920.jpg","datePublished":"2020-04-17T20:45:50+00:00","dateModified":"2023-12-01T10:41:22+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"The CSS transform property is used to apply a 2D transformation to an element. On Career Karma, learn how to create 2D transforms.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/css-2d-transforms\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/code-1839406_1920.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/04\/code-1839406_1920.jpg","width":1000,"height":668},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/css-2d-transforms\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"CSS","item":"https:\/\/careerkarma.com\/blog\/css\/"},{"@type":"ListItem","position":3,"name":"CSS 2D Transforms"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/14814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=14814"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/14814\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/14815"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=14814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=14814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=14814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}