I have an icon and I want it to grow when rolled over.
I want this icon to proportionately expand upwards, left and right, so its bottom center position needs to remain fixed where it starts.
I want to use pure CSS for this, no JS.
I can get it to expand in various ways, but all of them make the whole thing move upwards or downwards.
Here's where I'm at with it, any help will be greatly appreciated.
#sm-image {
width: 20px;
height: 20px;
margin: 0;
position: relative;
top: 0;
left: 0;
-webkit-transition: width 1s, height 1s, top 1s, left 1s, margin 1s;
-moz-transition: width 1s, height 1s, top 1s, left 1s, margin 1s;
-ms-transition: width 1s, height 1s, top 1s, left 1s, margin 1s;
transition: width 1s, height 1s, top 1s, left 1s, margin 1s;
}
#sm-image:hover {
width: 36px;
height: 36px;
top: -10px;
left: -10px;
bottom: 0;
margin-right: -10px;
margin-bottom: 0;
}
<img id="sm-image" src="https://pbs.twimg.com/profile_images/506394721812373504/IDmMstyJ.jpeg"></img>
<div style="width:100%;background-color:red;height:2px;"></div>
Thanks in advance.