{"id":3271,"date":"2022-04-05T09:00:00","date_gmt":"2022-04-05T09:00:00","guid":{"rendered":"https:\/\/cssdeck.com\/blog\/?p=3271"},"modified":"2022-04-04T09:45:04","modified_gmt":"2022-04-04T09:45:04","slug":"how-to-use-css-webkit-transform-scale","status":"publish","type":"post","link":"https:\/\/cssdeck.com\/blog\/how-to-use-css-webkit-transform-scale\/","title":{"rendered":"How to Use CSS Webkit Transform Scale"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">CSS Transform Property<\/h2>\n\n\n\n<p>You may use the CSS transform property to visually modify an element by <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/transform-function\/skew\"><strong>skewing<\/strong><\/a>, rotating, translating, or scaling it.<\/p>\n\n\n\n<p>The transform attribute transforms an element in 2D or 3D space.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/UTKXMlqEX3GqtKTjqXC8hPkeM2DyYrQcdlDFa_8hOn5DJnqyLYKCUzLWO6W3EIxBHHYSJgKSB2LdlrQgtSKpSsl5fBu0BsZ6MWhvJtamnIRDhTHHFXgsnwn_no_pl_ttbHoT7WAR\" alt=\"\" \/><\/figure><\/div>\n\n\n\n<p>Even if a height and width are specified, this element will now be scaled to twenty times its original size.<\/p>\n\n\n\n<p>If you provide this function with two values, the first will extend it horizontally and the second will stretch it vertically. In the following example, the element will be twice the width but half the height of the original.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/6cR16o4acOUeAaSvLKDGDGvv40Utnlu6D7v0eGffp48rROncw2r2XhMmrkW0KV2c0lSKTyncnIpHCEFZoIKbrXM_S9Rbc9yxj4t6ZfvoqBfJOQZS4Q0m9pnx2xmXup-h4h2rbjn4\" alt=\"\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">CSS Transform Values&nbsp;<\/h2>\n\n\n\n<ul><li>CSS Transform Scale()<\/li><\/ul>\n\n\n\n<p>This function Affects the element&#8217;s size. This also applies to an element&#8217;s font size, padding, height, and width. It also serves as a shortcut for the scaleX and scaleY operations.<\/p>\n\n\n\n<ul><li>SkewX() and SkewY()<\/li><\/ul>\n\n\n\n<p>This function Tilts an element to the left or right, similar to converting a rectangle to a parallelogram. The skew X and skew Y transform functions tilt an element one way or the other. Also, there is no shorthand property for skewing an element, so you\u2019ll need to use both functions.<\/p>\n\n\n\n<ul><li>Translate()<\/li><\/ul>\n\n\n\n<p>This transform function moves an element sideways, or up and down. It\u2019s important to note that an element using transform will not cause other elements to flow around it<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"496\" height=\"367\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-881.png\" alt=\"\" class=\"wp-image-3272\" \/><\/figure><\/div>\n\n\n\n<ul><li>Rotate()<\/li><\/ul>\n\n\n\n<p>The element is rotated clockwise from its present location. A positive value rotates an element clockwise from its initial location, whereas a negative value rotates it in the opposite way.<\/p>\n\n\n\n<ul><li>Matrix()<\/li><\/ul>\n\n\n\n<p>A function that combines all transformations into one and is presumably not intended to be written by hand.<\/p>\n\n\n\n<ul><li>Perspective()<\/li><\/ul>\n\n\n\n<p>This function has no effect on the element itself, but it does alter the 3D transformations of descendant elements, letting them all have a consistent depth perspective.<\/p>\n\n\n\n<p><strong>See Also: <a href=\"https:\/\/cssdeck.com\/blog\/rotate-html-elements-using-css-transform\/\">Rotate HTML Elements Using CSS Transform<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CSS Transform Scale<\/h2>\n\n\n\n<p>The CSS transform scale ()&nbsp; method specifies a transformation that resizes a 2D planar element. It may resize the horizontal and vertical dimensions at different scales since the quantity of scaling is determined by a vector. It yields a &lt;transform-function&gt; data type as a result.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/kntWg65r-KKzLNnN5ok_WdaxDOLl0jb-50jrZCKGMT-Ss0CpONrJ2Dq76ATZg_Vmnpr71JBZ2Nz89xn9uK2O_rGfVc4F9a6LwazQ5Biog10ml3C8QOdsw6veUe_MDrqAP8UBL_yb\" alt=\"\" \/><\/figure><\/div>\n\n\n\n<p>A two-dimensional vector characterizes this scaling change. Its coordinates specify how much scaling is performed in each direction. If both coordinates are the same, the scaling is uniform (isotropic), and the element&#8217;s aspect ratio is retained (this is a homothetic transformation).<\/p>\n\n\n\n<p>When a coordinate value is outside the [-1, 1] range, the element expands along that dimension; when it is inside, it contracts. If the value is negative, the outcome is a point reflection in that dimension. A value of 1 has no meaning.<\/p>\n\n\n\n<p>The scale() function only scales in 2D. To scale in 3D, use scale3d() instead.<\/p>\n\n\n\n<p>The scale() method takes one or two arguments, which specify the amount of scaling to be done in each direction. I.e., Scale (sx) and Scale (sx, sy).<\/p>\n\n\n\n<p><strong>See Also: <a href=\"https:\/\/cssdeck.com\/blog\/manipulate-capitalization-using-css-text-transform\/\">Manipulate Capitalization Using CSS\u2019s Text-Transform<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Scale Values<\/h2>\n\n\n\n<ul><li>SX : &lt;A number&gt; or &lt;percentage&gt; expressing the scaling vector&#8217;s abscissa.<\/li><\/ul>\n\n\n\n<ul><li>SY : A &lt;integer&gt; or &lt;percentage&gt; expressing the scaling vector&#8217;s ordinate. If it is not defined, the default value is sx, which results in uniform scaling that retains the aspect ratio of the element.<\/li><\/ul>\n\n\n\n<p>Scaling\/zooming animations are troublesome for accessibility since they are atypical migraine triggers. If you must include such animations on your website, give an option that allows visitors to turn them off, ideally site-wide.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"374\" height=\"317\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-883.png\" alt=\"\" class=\"wp-image-3273\" \/><\/figure><\/div>\n\n\n\n<p>Consider using the prefers-reduced-motion media feature to create a media query that disables animations if the user has a reduced animation set in their system options.<\/p>\n\n\n\n<p><strong>See Also: <a href=\"https:\/\/cssdeck.com\/blog\/making-animations-with-css3-transitions-and-transform-features\/\">Making Animations with CSS3 Transitions and Transform Features<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Multiple Values to CSS Transform<\/h2>\n\n\n\n<p>You may add several values to the transform property using a space-separated list.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"700\" height=\"286\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-884.png\" alt=\"css transform scale\n\" class=\"wp-image-3274\" \/><\/figure>\n\n\n\n<p>It&#8217;s important noting that these transformations are executed in a certain order; in the example above, &#8216;skew&#8217; is performed first, followed by the element being scaled.<\/p>\n\n\n\n<p><strong>See Also: <a href=\"https:\/\/cssdeck.com\/blog\/responsive-css-transitions-tips-and-tricks\/\">Responsive CSS Transitions: Tips and Tricks<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Matrix Transform<\/h2>\n\n\n\n<p>All transformations may be combined using the matrix transform function. It&#8217;s similar to transform shorthand, but I don&#8217;t think it&#8217;s meant to be written by hand. There are tools available that can turn a collection of transforms into a single matrix declaration, such as The Matrix Resolutions. In certain cases, this may reduce file size, but author-unfriendly micro improvements like that are unlikely to be worth your effort.<\/p>\n\n\n\n<p><strong>See Also: <a href=\"https:\/\/cssdeck.com\/blog\/5-advanced-css-techniques-to-master-in-2021\/\">5 Advanced CSS techniques to master in 2021<\/a><\/strong><\/p>\n<div class=\"wp-socializer wpsr-share-icons \" data-lg-action=\"show\" data-sm-action=\"show\" data-sm-width=\"768\" ><h3>Share and Enjoy !<\/h3><div class=\"wpsr-si-inner\"><div class=\"wpsr-counter wpsrc-sz-32px\" style=\"color:#000\"><span class=\"scount\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook,twitter,linkedin,pinterest,print,pdf\">0<\/span><\/span><small class=\"stext\">Shares<\/small><\/div><div class=\"socializer sr-popup sr-32px sr-circle sr-opacity sr-pad sr-count-1 sr-count-1\"><span class=\"sr-facebook\"><a rel=\"nofollow\" href=\"https:\/\/www.facebook.com\/share.php?u=\" target=\"_blank\"  title=\"Share this on Facebook\"  style=\"color: #ffffff\" ><i class=\"fab fa-facebook-f\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-twitter\"><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/intent\/tweet?text=%20-%20%20\" target=\"_blank\"  title=\"Tweet this !\"  style=\"color: #ffffff\" ><i class=\"fab fa-twitter\"><\/i><\/a><\/span>\n<span class=\"sr-linkedin\"><a rel=\"nofollow\" href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=\" target=\"_blank\"  title=\"Add this to LinkedIn\"  style=\"color: #ffffff\" ><i class=\"fab fa-linkedin-in\"><\/i><\/a><\/span>\n<span class=\"sr-pinterest\"><a rel=\"nofollow\" href=\"https:\/\/www.pinterest.com\/pin\/create\/button\/?url=&amp;media=&amp;description=\" target=\"_blank\"  title=\"Submit this to Pinterest\"  style=\"color: #ffffff\" data-pin-custom=\"true\"><i class=\"fab fa-pinterest\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"pinterest\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-print\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Print this article \"  style=\"color: #ffffff\" ><i class=\"fa fa-print\"><\/i><\/a><\/span>\n<span class=\"sr-pdf\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Convert to PDF\"  style=\"color: #ffffff\" ><i class=\"fa fa-file-pdf\"><\/i><\/a><\/span><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>CSS Transform Property<\/p>\n<p>You may use the CSS transform property to visually modify an element by skewing, rotating, translating, or scaling it.<\/p>\n<p>The transform attribute transforms an element in 2D or 3D space.&nbsp;<\/p>\n<p>Even if a height and width are specified, this element [&#8230;]<\/p>\n<p><a class=\"more-link article\" href=\"https:\/\/cssdeck.com\/blog\/how-to-use-css-webkit-transform-scale\/\" title=\"Click to read 'How to Use CSS Webkit Transform Scale'\">Read Article<\/a><\/p>\n","protected":false},"author":21,"featured_media":3275,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,4,41,172],"tags":[],"_links":{"self":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/3271"}],"collection":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/comments?post=3271"}],"version-history":[{"count":1,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/3271\/revisions"}],"predecessor-version":[{"id":3276,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/3271\/revisions\/3276"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media\/3275"}],"wp:attachment":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media?parent=3271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/categories?post=3271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/tags?post=3271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}