sean read
sean read

Reputation: 305

Stretch background image to fit

I'm trying to get the background image in my reveal.js presentation to adjust its aspect ratio to fit the screen. Changing the size seems simple enough via

data-background-size=...

but I can't find anything that shows me how to make the image stretch to fit the screen.

Upvotes: 5

Views: 2997

Answers (2)

Matthias Braun
Matthias Braun

Reputation: 34353

This stretches the image to fit the slide, keeping its aspect ratio:

data-background-size="contain"

The attribute is mentioned in the Backgrounds section of the documentation.

For possible values of data-background-size, see the MDN documentation.

Upvotes: 2

David Sevilla
David Sevilla

Reputation: 226

You can do it manually entering two parameters: data-background-size="800px 600px" for example.

Upvotes: 2

Related Questions