gpt4 book ai didi

html - 自定义可调整大小的 div

转载 作者:太空宇宙 更新时间:2023-11-03 18:36:01 26 4
gpt4 key购买 nike

创建可调整大小的 div(调整大小:两者都是 CSS)后,我准备在单击 div 的右下角后调整它的大小。在 Firefox 中它看起来像: item to change

但是我想把我的自定义图片放在那里,怎么办?

#resizeablediv {
width:200px;
height:200px;
resize:both;
background-color:black;
overflow:auto;
}

DEMO

最佳答案

这是获取自定义按钮/图像的方法 - 将您想要的任何内容放在 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>

关于html - 自定义可调整大小的 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18650529/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com