html - 为什么我的提交按钮在它的容器外面?

标签 html css

正如您在下图中看到的,我的提交按钮(法语中的“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;
}

enter image description here

最佳答案

因为你的公式位置是绝对的,它的容器高度是自动的(绝对定位的元素不影响它们的父元素高度)

将此 CSS 用于您的公式

#contactfrm {
    position: relative;
    float: left;
}

关于html - 为什么我的提交按钮在它的容器外面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26702758/

相关文章:

javascript - onmousedown IE8 不工作

javascript - 在路由到 Meteor 主页之前创建登录/注册页面?

javascript - float DIV 额外空间填充

html - 带十字而不是箭头的进度光标

html - Tailwind CSS 不必要的空白

html - 从 html 表值创建进度条

html - 为什么读取 localStorage 值需要刷新页面才能显示由 jQuery 切换的 CSS 更改?

html - overflow hidden 时滚动到顶部

php - 如何在下一页打印 PDF 后拆分表格行并删除标题内容颜色?

html - 在链接的 div 中创建链接的标题