I created a popup for a Chrome extension. This is the popup source code:
<form>
<label for="email">Email</label>
<input type="email" id="email">
<input type="submit">
<p>Hello, world! This is a paragraph. And this is some text.</p>
</form>
And this is how it should look:
As you see, the elements aren't in the right position.
According to the source of Chromium on 1/3/23, the default minimum width and height is 25px by 25px:
// The min/max height of popups.
// The minimum is just a little larger than the size of the button itself.
// The maximum is an arbitrary number and should be smaller than most screens.
static constexpr gfx::Size kMinSize = {25, 25};
static constexpr gfx::Size kMaxSize = {800, 600};
Your content appears to be out of position, because it's trying to fit within that width of 25px, but overflows instead.
Therefore, at least one of the parent elements of your content needs to be styled with a width that will fit your content.
In your case, the parent / container element <form>
could be styled.
There is more than one way to force the parent element's width to be a certain length, percentage, or keyword value:
<form>
tag
<form style="min-width: max-content !important">...</form>
<style> form { min-width: max-content !important; } </style>
form { min-width: max-content !important; }
For mobile web development, I would recommend to not use height
as another user suggested. Even though it's within a popup, please use min-height
instead. Otherwise you might have overlapping container elements, like I did until I used min-height.