gpt4 book ai didi

html - CSS 叠加关闭按钮响应

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

我有这个叠加层和这个叠加层框以及一个叠加层关闭按钮:

我的问题是,关闭按钮在台式机、平板电脑或移动设备上随处可见。我该如何解决这个问题,使其始终位于框的右下角。这是代码:

 .request-estimate {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 99999;
background-color: rgba(0,0,0,0.8);
display: none;
}

.request-estimate-box-container {
top: 0%;
position: fixed;
z-index: 99999;
}

.request-estimate-box {
display: none;
height: 400px;
width: 50%;
background-color: #FFF;
z-index: 99999;
position: fixed;
top: 5%;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
padding: 20px;
border-radius: 5px;
}

.request-estimate-close {
display: none;
position: fixed;
z-index: 99999;
color: #FFF;
bottom: 10%;
font-size: 26px;
left: 90%;
cursor: pointer;
}
<div class="request-estimate" style="display: block;"></div>
<div class="request-estimate-box-container">
<div class="request-estimate-box" style="display: block;">
<h1>Request Free Estimate</h1>
<form action="index.php" method="post">
<p>
<label for="name">Name</label>
<input type="text" name="name" id="name" class="form-control">
</p>
<p>
<label for="email">Email</label>
<input type="email" name="email" id="email" class="form-control">
</p>
<p>
<label for="phone">Phone</label>
<input type="phone" name="phone" id="phone" class="form-control">
</p>
<p>
<input type="submit" name="submit" id="submit" value="Submit" class="btn btn-default">
</p>
</form>
</div>
<div class="request-estimate-close" style="display: block;"><a href="#">X</a></div>
</div>


最佳答案

尝试用 css 属性 position: relative 将内容包装在一个 div 中;

关于html - CSS 叠加关闭按钮响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29584976/

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