gpt4 book ai didi

html - 如何使div向上切换

转载 作者:行者123 更新时间:2023-11-27 23:13:28 25 4
gpt4 key购买 nike

我正在制作一个迷你菜单,我已经使用 Bootstrap 切换来制作它。我想要的是迷你菜单应该向上而不是向下切换。我已经发布了我的代码。如果这可以用不同的方法实现,请告诉。

.mini-menu
{
position: absolute;
background-color: white;
border: 1px solid lightgrey;
padding-top: 15px;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 15px;
margin-left: -200px;
width: 200px;
}

.button-carrier
{
position: fixed;
top: 85%;
left: 75%;
}
.button-round {
border: none;
cursor: pointer;
color: white;
width: 60px;
height: 60px;
border-radius: 50%;
font-size: 22px;
box-shadow: 2px 2px 4px rgba(0, 0, 0, .4);
background: #2196F3;
}

.button-round {
position: relative;
overflow: hidden;
}

.button-round:after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 5px;
height: 5px;
background: rgba(255, 255, 255, .5);
opacity: 0;
border-radius: 100%;
transform: scale(1, 1) translate(-50%);
transform-origin: 50% 50%;
}

@keyframes ripple {
0% {
transform: scale(0, 0);
opacity: 1;
}
20% {
transform: scale(25, 25);
opacity: 1;
}
100% {
opacity: 0;
transform: scale(40, 40);
}
}

.button-round:focus:not(:active)::after {
animation: ripple 1s ease-out;
}
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="button-carrier">
<div class="mini-menu collapse">
<a href="#" >HOME</a>
<br />
<a href="#" >HOME</a>
<a href="#" >HOME</a>
<br />
<a href="#" >HOME</a>
<a href="#" >HOME</a>
<br />
<a href="#" >HOME</a>
</div>
<button class="button-round" data-toggle="collapse" data-target=".mini-menu"><i class="fa fa-bars"></i></button>
</div>

最佳答案

可能您想要这样的东西。

.mini-menu {
right: 100%;
width: 200px;
bottom: 0;
position: absolute;
}

.mini-menu.collapsing {
position: absolute;
}

.mini-menu .inner {
padding-top: 15px;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 15px;
background-color: white;
border: 1px solid lightgrey;
}

.button-carrier {
position: fixed;
bottom: 15%;
left: 75%;
}

.button-round {
border: none;
cursor: pointer;
color: white;
width: 60px;
height: 60px;
border-radius: 50%;
font-size: 22px;
box-shadow: 2px 2px 4px rgba(0, 0, 0, .4);
background: #2196F3;
}

.button-round {
position: relative;
overflow: hidden;
}

.button-round:after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 5px;
height: 5px;
background: rgba(255, 255, 255, .5);
opacity: 0;
border-radius: 100%;
transform: scale(1, 1) translate(-50%);
transform-origin: 50% 50%;
}

@keyframes ripple {
0% {
transform: scale(0, 0);
opacity: 1;
}
20% {
transform: scale(25, 25);
opacity: 1;
}
100% {
opacity: 0;
transform: scale(40, 40);
}
}

.button-round:focus:not(:active)::after {
animation: ripple 1s ease-out;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="button-carrier ">
<div class="mini-menu collapse">
<div class="inner">
<a href="#">HOME</a>
<br />
<a href="#">HOME</a>
<a href="#">HOME</a>
<br />
<a href="#">HOME</a>
<a href="#">HOME</a>
<br />
<a href="#">HOME</a>
</div>
</div>
<button class="button-round" data-toggle="collapse" data-target=".mini-menu"><i class="fa fa-bars"></i></button>
</div>

关于html - 如何使div向上切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44615424/

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