正如您在下图中看到的,我的提交按钮(法语中的“envoyer”)位于其容器之外(该容器具有红色背景,称为 .footer-content) 我无法在 jsfiddle 上重新创建问题,所以这里是直接链接(我无法使用 Firebug 识别问题)
.footer-content {
position: relative;
margin-right: auto;
margin-left: auto;
height: auto;
clear: both;
z-index: 9;
max-width: 700px;
background: red;
margin-top: 40px;
}
最佳答案
因为你的公式位置是绝对的,它的容器高度是自动的(绝对定位的元素不影响它们的父元素高度)
将此 CSS 用于您的公式
#contactfrm {
position: relative;
float: left;
}
关于html - 为什么我的提交按钮在它的容器外面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26702758/