Is there a way to resize a div to smaller than the declared height and width?
I\'m making an application where the user can resize a div and save it. However, when I loa
Just want to make a slight modification to what Pfft said in the accepted answer.
If you use the :active pseudo-class instead of :hover it doesn't have the flicker when you hover over the element. That flicker is really annoying.
div:active {
width: 0;
height: 0;
}
By using :active what happens is when clicking on the element it will be resized to the height: 0, width: 0 so a little dot where the 1px border is will be shown but as soon as the user starts resizing you get exactly what you would want in resizing. And on every subsequent resize there is no glitch and it just works perfectly.
I find this to be much less annoying than using hover. Thanks to Pfft for the above response, it was exactly what I was looking for and led me to my own slightly altered solution!
Here's a jsfiddle of it: http://jsfiddle.net/kronenbear/v4Lq5o09/1/