The API will auto crop your image to the height/width of the outermost HTML element. For example, the following will generate a screenshot that is 400px wide and 400px tall.
<div style="height: '400px'; width: '400px'"><h1>Hello, world</h1></div>
Margins are respected by the API. To add padding around your image, you can do the following.
<div style="height: '400px'; width: '400px'; margin: 10px; border: 5px solid #03B875;"><h1>Hello, world</h1></div>
For best performance, we recommend a maximum of 2000x2000 pixels in your HTML. This will result in a 4000x4000 pixel image (because we render everything
@2X for retina screens).
Once an image is generated, use our API to adjust the image to any size you need with the width and height params. When only one param is passed, the API will maintain the aspect ratio of the original image.
This is useful for displaying images at different resolutions without having to setup your own CDN.