【问题标题】:I need the button to always be down我需要按钮始终处于关闭状态
【发布时间】:2021-09-28 20:26:26
【问题描述】:
目前该按钮始终位于视图中存在的最后一个元素的下方。
然后我将底部:2px 和位置:绝对添加到按钮,它会到底部,但是当我打开下拉菜单时,屏幕被放大并且按钮不在底部。
它目前的工作方式是这样的。我希望它继续像这样工作,但底部有按钮
放置底部:2px 和位置:绝对按钮到底部,但当下拉菜单打开时,它会重叠。
【问题讨论】:
标签:
html
css
sass
css-transitions
【解决方案1】:
<style>
.card-one{display:flex;}
.card-section{display:flex;margin:5px;text-align:center; min-height:300px;background:#000; flex-direction: column; width:33%;color:#fff;}
.card-section h2{color:#fff;}
.card-section .book-btn{margin-top:auto;}
</style>
<div class="card-one">
<div class="card-section">
<h2>Hello One</h2>
<button class="btn book-btn">Book Now</button>
</div>
<div class="card-section">
<h2>Hello One</h2>
<button class="btn book-btn">Book Now</button>
</div>
</div>