{"id":22319,"date":"2014-11-06T18:01:42","date_gmt":"2014-11-06T10:01:42","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=22319"},"modified":"2025-04-24T17:10:00","modified_gmt":"2025-04-24T09:10:00","slug":"css-transform-ie","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/","title":{"rendered":"How to Enable CSS Transform in IE6-8 [Quick Tip]"},"content":{"rendered":"<p>Modern browsers have a lot of support for most CSS3 properties. You can essentially apply <a href=\"https:\/\/www.hongkiat.com\/blog\/creative-css-animations\/\">CSS animations<\/a>, transformations and gradients among other things with ease. However, there are still many users of older versions of Internet Explorer that <strong>don\u2019t exactly support the newer CSS3 properties<\/strong>. In this article, I will share quick tips <strong>on how to enable CSS transform on IE6-8<\/strong>.<\/p>\n<p><strong>The CSS Transform property allows us to transform an element in two-dimensional or three-dimensional space<\/strong>. You can translate, scale, rotate and skew an element using CSS Transform. For modern browsers like Firefox, Opera and Webkit-based browsers support CSS Transform with their vendor-specific prefixes (using <code>-moz-transform<\/code>, <code>-o-transform<\/code> and <code>-webkit-transform<\/code> respectively), but you will not find it on Internet Explorer. So herein, I will use a JavaScript library called <strong>cssSandpaper<\/strong> that allows cross-browser CSS Transforms, even in old IE.<\/p>\n<p class=\"note\"><strong>Recommended Reading:<\/strong> <a href=\"https:\/\/www.hongkiat.com\/blog\/css-cubic-bezier\/\">A Look Into: Cubic-Bezier In CSS3 Transition<\/a><\/p>\n<h2>Getting Started<\/h2>\n<p>First, download <strong>cssSandpaper<\/strong> from the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/zoltan-dulac\/cssSandpaper\">Github Repository<\/a>. Then, include the following required JavaScript libraries which come with cssSandpaper.<\/p>\n<pre>\n&lt;script type=\"text\/javascript\" src=\"\/path\/to\/js\/EventHelpers.js\"&gt;&lt;\/script&gt;\n&lt;script type=\"text\/javascript\" src=\"\/path\/to\/js\/cssQuery-p.js\"&gt;&lt;\/script&gt;\n&lt;script type=\"text\/javascript\" src=\"\/path\/to\/js\/jcoglan.com\/sylvester.js\"&gt;&lt;\/script&gt;\n&lt;script type=\"text\/javascript\" src=\"\/path\/to\/js\/cssSandpaper.js\"&gt;&lt;\/script&gt;\n<\/pre>\n<h2>The <em>-sand-transform<\/em> Property<\/h2>\n<p>cssSandpaper <strong>introduces a new prefixed property to apply the transformation<\/strong>. This new property can be used in conjunction with the other browser-vendor prefixes like <code>-moz-transform<\/code>, <code>-webkit-transform<\/code>, or other browser-prefixed properties, like so:<\/p>\n<pre>\n#container {\n    -moz-transform: &lt;function-list&gt;;\n    -webkit-transfrom: &lt;function-list&gt;;\n    -sand-transform: &lt;function-list&gt;;\n    transform: &lt;function-list&gt;;\n}\n<\/pre>\n<p>The cssSandpaper inherits the standard CSS functions to perform the transformation such as rotation and scaling. The following is a list of the functions you can use within the <code>-sand-transform<\/code> property.<\/p>\n<ul>\n<li><strong>rotate(angle)<\/strong> is used to rotate an element in degrees or radians. e.g: <code>-sand-transform: rotate(45deg)<\/code><\/li>\n<li><strong>scale(sx[, sy])<\/strong> is used to scale an element. e.g: <code>-sand-transform: scale(1[,2])<\/code> this means we scale the element on the <strong>X-axis<\/strong> according to the original size and on the<strong> Y-axis<\/strong> as twice the original size.<\/li>\n<li><strong>skewX(ax)<\/strong> and <strong>skewY(ay)<\/strong> are used to skew an element around the x and y axes by the specified angles in degrees or radian. e.g: skewX(30deg)<\/li>\n<li><strong>matrix(a, c, b, d, tx, ty)<\/strong> is used to make 2D transformation matrix comprised of the specified six values. <\/li>\n<\/ul>\n<h2>Use Example<\/h2>\n<p>Assuming we have built a box using a <code>&lt;div&gt;<\/code>. And now you want the box to move <code>200px<\/code> horizontally away from its initial position, and at the same time rotate it 45 degrees. You can use cssSandpaper to achieve this effect, as follows:<\/p>\n<pre>\n#box{\n    width: 150px;\n    height: 100px;\n    -sand-transform:  translate(200px, 0) rotate(45deg);\n}\n<\/pre>\n<p>You can see the demo below. Do take note that you should look at it in Internet Explorer 6-8 as well.<\/p>\n<div class=\"button\">\n  <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/css-sandpaper\/\">View Demo<\/a>\n  <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/hongkiat\/css-sandpaper\/\">Download Source<\/a>\n<\/div>\n<h2>Conclusion<\/h2>\n<p>This <strong>might not be the most elegant solution<\/strong> as we need to stack a bunch of JavaScript libraries to achieve this simple effect. But in case your boss or client insists on enabling rotation in Internet Explorer 8 (for whatever nonsensical reason), you can use <strong>cssSandpaper<\/strong> to make this happen.<\/p>","protected":false},"excerpt":{"rendered":"<p>Modern browsers have a lot of support for most CSS3 properties. You can essentially apply CSS animations, transformations and gradients among other things with ease. However, there are still many users of older versions of Internet Explorer that don\u2019t exactly support the newer CSS3 properties. In this article, I will share quick tips on how&hellip;<\/p>\n","protected":false},"author":141,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3392,352],"tags":[507,4501],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Enable CSS Transform in IE6-8<\/title>\n<meta name=\"description\" content=\"Modern browsers have a lot of support for most CSS3 properties. You can essentially apply CSS animations, transformations and gradients among other things\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Enable CSS Transform in IE6-8 [Quick Tip]\" \/>\n<meta property=\"og:description\" content=\"Modern browsers have a lot of support for most CSS3 properties. You can essentially apply CSS animations, transformations and gradients among other things\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2014-11-06T10:01:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T09:10:00+00:00\" \/>\n<meta name=\"author\" content=\"Agus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bagusdesain\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Agus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-transform-ie\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-transform-ie\\\/\"},\"author\":{\"name\":\"Agus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/b23dad06815dff0bcc222088bed549dd\"},\"headline\":\"How to Enable CSS Transform in IE6-8 [Quick Tip]\",\"datePublished\":\"2014-11-06T10:01:42+00:00\",\"dateModified\":\"2025-04-24T09:10:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-transform-ie\\\/\"},\"wordCount\":453,\"commentCount\":12,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"keywords\":[\"CSS\",\"CSS Tutorials\"],\"articleSection\":[\"Coding\",\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-transform-ie\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-transform-ie\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-transform-ie\\\/\",\"name\":\"How to Enable CSS Transform in IE6-8\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"datePublished\":\"2014-11-06T10:01:42+00:00\",\"dateModified\":\"2025-04-24T09:10:00+00:00\",\"description\":\"Modern browsers have a lot of support for most CSS3 properties. You can essentially apply CSS animations, transformations and gradients among other things\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-transform-ie\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-transform-ie\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-transform-ie\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Enable CSS Transform in IE6-8 [Quick Tip]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/b23dad06815dff0bcc222088bed549dd\",\"name\":\"Agus\",\"description\":\"Agus is a music enthusiast, backpacker and code writer. He has an ambition to build a Skynet on top of HTML and CSS.\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/bagusdesain\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/agus\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Enable CSS Transform in IE6-8","description":"Modern browsers have a lot of support for most CSS3 properties. You can essentially apply CSS animations, transformations and gradients among other things","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:\/\/www.hongkiat.com\/blog\/css-transform-ie\/","og_locale":"en_US","og_type":"article","og_title":"How to Enable CSS Transform in IE6-8 [Quick Tip]","og_description":"Modern browsers have a lot of support for most CSS3 properties. You can essentially apply CSS animations, transformations and gradients among other things","og_url":"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2014-11-06T10:01:42+00:00","article_modified_time":"2025-04-24T09:10:00+00:00","author":"Agus","twitter_card":"summary_large_image","twitter_creator":"@bagusdesain","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Agus","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/"},"author":{"name":"Agus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/b23dad06815dff0bcc222088bed549dd"},"headline":"How to Enable CSS Transform in IE6-8 [Quick Tip]","datePublished":"2014-11-06T10:01:42+00:00","dateModified":"2025-04-24T09:10:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/"},"wordCount":453,"commentCount":12,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"keywords":["CSS","CSS Tutorials"],"articleSection":["Coding","Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/","url":"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/","name":"How to Enable CSS Transform in IE6-8","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"datePublished":"2014-11-06T10:01:42+00:00","dateModified":"2025-04-24T09:10:00+00:00","description":"Modern browsers have a lot of support for most CSS3 properties. You can essentially apply CSS animations, transformations and gradients among other things","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/css-transform-ie\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Enable CSS Transform in IE6-8 [Quick Tip]"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/b23dad06815dff0bcc222088bed549dd","name":"Agus","description":"Agus is a music enthusiast, backpacker and code writer. He has an ambition to build a Skynet on top of HTML and CSS.","sameAs":["https:\/\/x.com\/bagusdesain"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/agus\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-5NZ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/22319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/141"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=22319"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/22319\/revisions"}],"predecessor-version":[{"id":74104,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/22319\/revisions\/74104"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=22319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=22319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=22319"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=22319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}