html - 让 <object> 标签填满整个窗口并调整大小

标签 html css google-chrome google-nativeclient

我有一个适用于 Chrome 的 NaCl 插件,我想用它填充整个窗口。 HTML 是这样的:

<!DOCTYPE html>
<html>
  <head></head>
  <body>
    <div class="container,box">
      <object class="internal,box"></object>
    </div>
  </body>
</html>

我尝试了几种风格:

  1.     html {
          height: 100%;
        }
        .box {
          position:absolute;
          left/right/top/bottom: 0;
          display:block;
          padding: 5px
        }

    填充整个窗口,保持默认大小 300x150。

  2.     html, body, .box { padding: 0; border: 0; margin: 0; width: 100%; height: 100% }
        .container { padding: 5px; } 

    填充整个窗口,但它的宽度/高度不受填充影响,因此它会溢出包含

有人遇到过类似的问题吗?任何 CSS 解决方案? 我只需要它在 Chrome 中工作。

最佳答案

.internal {
    width: 100%;
    height: 100%;
}

.container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
 }

关于html - 让 <object> 标签填满整个窗口并调整大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13040567/

相关文章:

html - 在 html 中对齐文本框和文本/标签?

jquery - 将点击事件更改为 onmouseover 以进行 Bootstrap 导航

google-chrome - 是什么原因导致Chrome时间轴框架中有太多空白

twitter-bootstrap - Bootstrap 拉伸(stretch)链接在 Chrome 和 Edge 上损坏,但在 Firefox 上有效

jquery - 使用 Jquery 逐行选择表格内的所有复选框

javascript - 启用/禁用按钮的下拉菜单

html - Bootstrap : Buttons in a row with no gap between

jquery - 检测链接是否被点击,如果点击了则应用不同的 CSS 类

某个类的所有跨度的标题的css

javascript - 防止 IndexedDb 在 Chrome 中呈指数级增长