How to restrict the size of a Google chrome extension popup?
I am creating a Google Chrome extension that does some basic search based on the choices provided.
This is how it l开发者_如何学运维ooks so far
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?
as nkorth said, this is quite easy, using CSS. Let me write out the code for you:
<html>
<head>
<style type="text/css">
body {
width: 200px;
height: 200px;
overflow: hidden;
}
</style>
</head>
<body>
text text text
</body>
</html>
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.
You can follow Debugging Tutorial to inspect this popup.
Maybe set the min-width
property to body
element could fix it. If not, please append the html code, we can check it later.
精彩评论