如何限制Google Chrome扩展程序弹出窗口的大小? [英] How to restrict the size of a Google chrome extension popup?

查看:597
本文介绍了如何限制Google Chrome扩展程序弹出窗口的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Google Chrome浏览器扩展程序,可根据所提供的选择进行一些基本搜索。

I am creating a Google Chrome extension that does some basic search based on the choices provided.

目前为止它的样子

问题是两边有很多空白,看起来不太好,特别是因为这是一个弹出窗口并覆盖当前页面。

The problem is that there is a lot of white space on the sides which does not look good, especially because this is a popup and overlays on the current page.

如何确保弹出使用所需的最小空间量?

How can I make sure that the popup uses the minimum amount of space required?

推荐答案

它应该像设计样式一样简单 body 元素。你想要一个固定的大小,固定的宽度,还是只有较少的利润?对于固定大小,您应该使用 overflow:scroll overflow:hidden 以及相应的宽度高度。对于固定宽度,使用 width 和可选的 min-height 。对于其中的任何一种,您应该检查所有块级元素的边距,看看这是否是您的空白来自哪里。

It should be as simple as styling the body element. Do you want a fixed size, fixed width, or just less margins? For fixed size, you should use overflow:scroll or overflow:hidden along with the appropriate width and height. For fixed width, use width and optionally min-height. For any of these, you should check the margins on all the block-level elements to see if that's where your whitespace is coming from.

这篇关于如何限制Google Chrome扩展程序弹出窗口的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆