Resize a div to smaller than its declared size?

前端 未结 6 999
醉话见心
醉话见心 2021-02-07 14:50

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

6条回答
  •  别那么骄傲
    2021-02-07 15:46

    You requested a workaround for your problem, or was wondering how-to at least. I made you a simple workaround that might require a little work; note it is a workaround, and might therefore contain glitches.

    .cls {
        width: 100px;
        height: 100px;
        resize: both;
        overflow: auto;
        border: 1px dotted #000;
    }
    
    .cls:hover {
        width: 1px;
        height: 1px;
    }
    

    ​ Updated fiddle: http://jsfiddle.net/FNXnD/1/

    • Note Chrome, and Safari might change the CSS3 resize feature in future versions.

提交回复
热议问题