html - 输入组不适合 Chrome 中的整个 td 内容

标签 html css twitter-bootstrap

我有以下网页:

HTML

<div class="center-both">
  <table>
    <tr>
      <td></td>
      <td>
        <img src="http://placehold.it/246x105">
      </td>
      <td></td>
    </tr>
    <tr>
      <td>
        <img src="http://placehold.it/128x128">
      </td>
      <td>
        <img src="http://placehold.it/640x390">
      </td>
      <td>
        <img src="http://placehold.it/128x128">
      </td>
    </tr>
    <tr>
      <td></td>
      <td>
        <div class="input-group">
          <input id="video-url" type="text" class="form-control" value="some_text">
          <div class="input-group-btn">
            <button id="copy-clipboard" type="button" class="btn btn-default">
              <i class="glyphicon glyphicon-copy"></i>
            </button>
          </div>
        </div>
      </td>
      <td></td>
    </tr>
  </table>
</div>

CSS

.center-both {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  -webkit-transform: translate(-50%,-50%);
  -webkit-filter: blur(0);
}

.center-both img {
  display: block;
  margin: auto;
}

(JSFiddle 链接——https://jsfiddle.net/7rkrfj87/2/)

它在 Firefox 中看起来符合预期:

enter image description here

但是在 Chrome 中 input-group 并不适合整个 td:

enter image description here

为什么?我究竟做错了什么?我怎样才能强制它适应整个 td

最佳答案

你可以添加 width: 100% duh!

.input-group {
    position: relative;
    display: table;
    border-collapse: separate;
    width: 100%;
}

我已经在 Chrome、Firefox 中查看过了。

fiddle :https://jsfiddle.net/fLs7t1v8/

关于html - 输入组不适合 Chrome 中的整个 td 内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34354517/

相关文章:

html - Bootstrap 4 中列之间的空白垂直空间

html - 将文本垂直对齐到我的列 div 的中间

html - 标题的 CSS 问题以及表格和页面边框之间缺少正确的空格

html - 有没有人试过为PSP设计网页?

javascript - Bootstrap 表单没有响应

css - 小于 1920 x 1080 分辨率的 Bootstrap 响应缩放问题

javascript - 从外部 javascript 文件获取ElementById

Javascript 通过 getElementbyId 访问动态创建的元素

php - Wordpress 错误 "Invalid CSS"但引用的 CSS 不是我的 CSS

javascript - 添加兄弟 div 后更改 div 的样式