🖼️
vue-progressive-image
v5
v5
  • Get started
  • Placeholder image
  • Lazy loading
  • Fallback image
  • Image as background
  • Adjust the blur
  • Events
  • Custom CSS class
  • Delay animation
  • CSS Variables
Powered by GitBook
On this page

Image as background

To maintain all the functionalities of the plugin in the case of images that are part of an element background, you can use the object-cover attribute; this will allow the image to fit the size of the parent using the object-fit: cover CSS property.

The image will be centered and cropped to fit the parent element size.

<template>
  <header class="header">
    <ProgressiveImage
      object-cover
      src="https://picsum.photos/id/1080/1980/1080"
    />
  </header>
</template>

<style>
.header {
  width: 100%;
  height: 500px;
}
</style>
PreviousFallback imageNextAdjust the blur