gpt4 book ai didi

html - 使图像从屏幕外滑入 HTML

转载 作者:行者123 更新时间:2023-11-28 16:58:04 24 4
gpt4 key购买 nike

当我点击这个 div 时,我想要一张图片从屏幕外的底部滑入以覆盖其余部分:

<div class="brick" title="Brick Squad" alt="Brick Squad" onclick="location.href='#';" style="cursor: pointer;" action="wall-in">
</div>

我只想使用 HTML 和 CSS!

最佳答案

* {
box-sizing: border-box;
font-family: inherit;
margin: 0;
padding: 0;
}

html {
font-size: 62.25%;
}

body {
font-family: sans-serif;
font-size: 1.6rem;
}

.opener > span {
display: inline-block;
background-color: dodgerblue;
padding: 1rem;
margin: 1rem;
color: #fff;
border-radius: .3rem;
}

.opener > input {
display: none;
}

.opener > input:checked ~ .img {
top: 6rem !important;
}

.img {
position: fixed;
width: 100%;
height: 100%;
left: 0;
max-height: 100vh;
top: 100%;
transition: .6s;
}
<label for="ooop" class="opener">
<span>Toogle Me</span>
<input type="checkbox" name="" id="ooop">
<img class="img" src="https://images.pexels.com/photos/849835/pexels-photo-849835.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940" alt="">
</label>

关于html - 使图像从屏幕外滑入 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55339667/

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