For a website, i want 70% of the page to be covered with an image. However the image is just blank. I use Vue.js as my frontend. Here is the code that results in a blank space:
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue';
</script>
<template>
<div style="background-image: `url(${require('../assets/bg.png')})`;
height: 70vh" class="full-width-image">
</div>
<div class="container">
<div class="row">
<div class="col">
</div>
</div>
<div class="row">
<div class="col">
<h1>Test</h1>
<p>test test test!</p>
</div>
</div>
</div>
</template> -
<style>
.full-width-image {
margin: auto;
padding: 0;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
}
</style>
Import the image as module then bind it to the style background :