I have some text mixed with emoji (small images), currently I have a feature where if you mouse over those emojis they will enlarge in-place, this is done using the following css
.emoji:hover {
transform: scale(2);
}
.emoji {
width: 32px;
height: 32px;
transition: all 0.2s ease;
}
I want to have the emojis scale to their original size, rather than to a fixed amount, kinda like the following
.emoji:hover {
width: auto;
height: auto;
}
.emoji {
width: 32px;
height: 32px;
transition: all 0.2s ease;
}
Yet this have the undesirable side-effect of re-flowing the text which transform: scale(2)
doesn't have. Is there some way around it?
a working example: https://jsfiddle.net/05eanuf4/