Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css3 transform scale stick to bottom

Is it possible to use the transform: scale(x) property while keeping the element stuck to the bottom of the page? (by default if scales relative to the center of the element as shown below)

default scale behavior
(source: w3schools.com)

like image 221
Raz Avatar asked Aug 27 '12 22:08

Raz


1 Answers

use the transform-origin property :

element{
    -webkit-transform : scale(0.5);
    -moz-transform : scale(0.5);
    -o-transform : scale(0.5);
    -ms-transform : scale(0.5);
    transform : scale(0.5);

    -webkit-transform-origin : 50% 100%;
    -moz-transform-origin : 50% 100%;
    -o-transform-origin : 50% 100%;
    -ms-transform-origin : 50% 100%;
    transform-origin : 50% 100%;
}

Here's a live demo that shows the transform-origin in action.

like image 188
gion_13 Avatar answered Oct 02 '22 16:10

gion_13