Fr0stY Fr0stY - 5 months ago 6x
HTML Question

How to animate an element on hover

How can I make my

elements grow (and the content changes text size to a higher one), when hovered over? I put them in a class and tried:

size: 150%;


height: +30px;
width: +30px;

the first try didn't work at all, and the second code just made the div's flash and dissappear partially.


CSS3 solution:

div {
    background: #999;
    width: 200px;
    height: 20px; 
    transition: width 1s;

    width: 300px;
    <p>Im content</p>