Skip to content

Options

styles

CSS added to the page right before the capture.

Type
string
Default
None
On this page

OverviewLink to this section

CSS added to the page right before the capture, after your script. Use it to hide elements, swap fonts, pin a sticky header in place or force a theme.

Sites often style their own elements strongly, so add !important to rules that must win.

ExampleLink to this section

The same request with the SDK, with cURL and as the raw JSON body.

screenshot.ts
import { Url2Image } from '@url2image/sdk'

const { success, data, message } = await Url2Image({
    url: 'https://example.com',
    token: process.env.URL2IMAGE_TOKEN,
    options: {
        styles: 'header { position: static !important; } .chat-widget { display: none !important; }'
    }
})

Good to knowLink to this section

Every option, grouped, is in the options overview.

Something unclear or missing on this page?

Tell us
Made with Modulify