我不知道如何让这个模式中的按钮按我想要的方式运行。我需要它距模态底部 20px(当然居中。)
模态框本身似乎也没有居中。请帮我也这样做。
我会把网址放在评论里。
只需点击网站顶部的“会见赞助商”按钮,即可打开模式。
最佳答案
去掉外面的<div>
包装 <button>
并将以下 css 添加到您的按钮类,即 .md-content button
.
position: absolute;
left: 0; (instead of left: 109.2px; used by you)
right: 0;
整个类(class)看起来是这样的:
.md-content button {
background: rgba(0,0,0,0.5);
color: #fff;
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.5);
transition: all 0.3s ease 0s;
text-align: center;
bottom: 20px;
position: absolute;
left: 0;
right: 0;
}
关于css - 绝对位置按钮(以它所在的中心模式),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57940902/