EN
CSS - resize property doesn't work
1
answers
0
points
I'm trying to create resizable
element using CSS and the resize
property doesn't seem to work. Can you help me with this?
My code:
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<head>
<style>
.resizable {
height: 100px;
width: 100px;
border: 2px solid;
border-radius: 5px;
resize: both; /* <----- doesn't work */
}
</style>
</head>
<body style="height: 150px;">
<div class="resizable"></div>
</body>
</html>
1 answer
0
points
Your problem is that you haven't set the overflow
property that by default has visible
value. Change it to auto
or scroll
and everything works.
Practical example:
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<head>
<style>
.resizable {
height: 100px;
width: 100px;
border: 2px solid;
border-radius: 5px;
resize: both;
overflow: auto; /* or 'scroll' */
}
</style>
</head>
<body style="height: 150px;">
<div class="resizable"></div>
</body>
</html>
0 comments
Add comment