【问题标题】:How can I resize the Chrome extension popup?如何调整 Chrome 扩展弹出窗口的大小?
【发布时间】:2020-03-25 23:23:16
【问题描述】:

编辑:修复是使用属性 white-space = "white-space: nowrap"。

Popup 位于左侧,右侧是常规 html 页面的外观。如何使弹出窗口看起来像普通的 html 页面?

在图片中,有 css 格式,但我将其全部删除,文本一直这样中断。

【问题讨论】:

  • 分享你的代码

标签: html css google-chrome google-chrome-extension


【解决方案1】:

看起来没有<!DOCTYPE html> 会导致类似的问题。检查你有没有。

否则,您可以像这样动态调整它的大小:

document.getElementsByTagName("html")[0].style.width = ""+width;
document.getElementsByTagName("html")[0].style.height = ""+height;

或者像这样来自 CSS:

body {
  min-height: 100vh;
}

希望这有帮助!

【讨论】:

  • 谢谢。我可以通过简单地添加属性“white-space: nowrap”来修复它。
猜你喜欢
  • 1970-01-01
  • 2016-07-03
  • 1970-01-01
  • 2016-12-30
  • 2021-04-22
  • 1970-01-01
  • 2023-01-02
  • 2019-10-22
  • 2011-09-27
相关资源
最近更新 更多