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 anywhere that shows me how to make the image stretch to fit the screen
You can do it manually entering two parameters: data-background-size="800px 600px"
for example.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With