在创建可调整大小的div (调整大小:都是CSS)之后,我将在单击div的右下角后调整它的大小。在firefox中,如下所示:

但我想把我的自定义形象,怎么做呢?
#resizeablediv {
width:200px;
height:200px;
resize:both;
background-color:black;
overflow:auto;
}DEMO
发布于 2013-09-06 06:08:44
所以我做了一些关于调整尺寸的研究。它是如此的新,并不是所有的主流浏览器都支持它。据我所知,还没有一个现有的方法来重新设计这个元素。
下面是调整大小的规范页面:
https://developer.mozilla.org/en-US/docs/Web/CSS/resize
所以你有两个选择,这两个选项都不是完美的:
1)背景图像。它不会隐藏调整大小的图标,但至少会屏蔽它。
2)覆盖一个div,以包含您的图像指针-事件:无;应用于它。图标将仍然在那里,但它可以隐藏在一个绝对定位的div下包含您的图像。
.custom-image{
background:pink; //you could set this background to your custom image.
height:7px;
width:7px;
position:absolute;
bottom:0px;
right:0px;
pointer-events: none;
}我更新了你的小提琴以证明。DEMO
发布于 2020-04-04 08:31:44
以下是如何获得自定义按钮/图像-在div的右下角放置任何您想要的东西
.parent {
border: none;
cursor: pointer;
display: inline-block;
padding: 0;
position: relative;
}
.parent:after {
border: 3px solid cyan;
border-radius: 50%;
bottom: 0;
box-shadow: inset 0 0 0 1px rgba(14, 19, 24, .15);
box-sizing: border-box;
content: " ";
cursor: pointer;
display: block;
pointer-events: none;
position: absolute;
right: 0;
height: 20px;
width: 20px;
animation: blink 2s infinite;
}
@keyframes blink {
from,
to {
background: rgba(0, 255, 255, 0.5)
}
50% {
background: transparent
}
}
.child {
background: salmon;
cursor: pointer;
height: 150px;
width: 345px;
min-width: 300px;
min-height: 150px;
max-height: 100vh;
max-width: 100vw;
opacity: 0;
overflow: auto;
pointer-events: none;
resize: both;
background: #444;
}
.content {
padding: 20px;
position: absolute;
left: -7px;
right: -7px;
top: -7px;
bottom: -7px;
color: cyan;
font-family: Arial;
background: #444;
letter-spacing: 2px;
border-radius: 15px;
}<div class='parent'>
<div class="content">
r e s i z e a b l e r e s i z e a b l e r e s i z e a b l e r e s i z e a b l e r e s i z e a b l e r e s i z e a b l e r e s i z e a b l e r e s i z e a b l e r e s i z e a b l e r e s i z e a b l e r e s i z e a b l e r e s i z e a b l e
</div>
<div class="child"></div>
</div>
发布于 2013-09-06 05:52:48
background: grey url(http://i.stack.imgur.com/Ckblr.png) no-repeat bottom right;https://stackoverflow.com/questions/18650529
复制相似问题