Steps to set a background image for an entire page in VueJS

I recently downloaded a Background Image to add to the Home Page of my VueJS application. Unfortunately, when the page loads, only a portion of the page is covered by the image. My goal is to have the entire page filled with the image, except for the Navbar section.

Below is the code snippet from my HomeView.vue:

<template>
<div id="Home">
    <h1 class="header"> Welcome {{name}} </h1>
        <h2>A very warm welcome to v2 of QuantifiedSelf</h2>
  </div>      
</template>

<script>
import axios from 'axios';


export default {
Name: 'HomeView',
mounted() {
    axios.get('http://localhost:5000/')
    .then((resp ) => console.log(resp.data))
    .catch((err) => console.log(err.response))
},
data() {
    return {
        name: localStorage.name,
    }
},
};

</script>

<style>
.header{
    margin-top: 80px;
}
#Home{
    background-image: url("../Pics/pic1.jpeg");
    margin-bottom: 250px;
}

</style>

View the current state of the Home page: https://i.sstatic.net/F65FZ.png

Any suggestions on how to cover the entire page with the background image?

Answer №1

Here is the solution to your issue:

#home {
   min-height: 100vh
   /*...*/
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

hover effect with fading transition while mouse is still hovering

Is there a way to create a fade-in/fade-out effect on a div without the mouse needing to leave the area? Let me provide a clearer explanation: When the mouse enters the object The object gradually fades in Then, after a delay, the object fades out while ...

The carousel spun around, each section moving to the side on its own

One issue I'm facing is that on my page, I have multiple carousel rows. However, when I click on the "next" or "prev" button to navigate through the items in the carousel, it affects all carousels instead of just the one I clicked on. I've attem ...

Tips for Eliminating Unnecessary Space Above the Navigation Bar

I have a problem with the top navbar on my test site. There is some extra space above it that I want to remove so that the navigation extends all the way up to cover the viewport. Here is an image of what I'm trying to achieve: https://i.stack.imgur.c ...

Fixing W3 Validation Errors in your Genesis theme through CSS requires a few simple steps. Let's

As a newcomer to this forum, I kindly ask for understanding regarding my current issue. Upon checking my website vocaloid.de/Wordpress/ using the W3C CSS validator, I discovered several parsing and value errors. In an attempt to solve this, I disabled all ...

A step-by-step guide on connecting an event listener to the search input of Mapbox GL Geocoder in a Vue application

I've encountered a challenge trying to add an event listener to the Mapbox GL Geocoder search input within a Vue application. It appears to be a straightforward task, but I'm facing difficulties. My objective is to implement a functionality simi ...

drag and drop functionality in Vue not triggering added method

Why are Vue draggable added/removed/moved methods not being invoked when an item is dragged or moved? Can you please suggest the necessary code changes to trigger these methods? <v-expansion-panel-data > <draggable ...

Retrieve the component information from the JavaScript function located outside of the main code

Is there a way to retrieve the component data using an external JavaScript function? I am looking to access markers, labels, and images. Vue.component('home', { template: '#home', data: () => ({ markers: [ ...

Mastering the Material-UI Grid in SPAs: Conquering the Negative Margin Dilemma

While attempting to build a single page application (SPA), I've encountered an issue with using the Grid component from material-ui. Normally, I rely heavily on the Grid, but in this new project, something seems amiss. The current problem is evident ...

Encountering a problem with Vue when running the node-rdkafka package

I added node-rdkafka to my project using the command npm install node-rdkafka. Then, I included it in my code like this: import Kafka from 'node-rdkafka'; created() { console.log(Kafka.features); } An error occurred when running npm r ...

Is it possible to resize background images on Safari?

Encountering an issue with Safari where the background isn't scaling properly. It functions perfectly in Firefox, Chrome, and other browsers, but Safari is presenting a problem. Here's a link to the site: This issue occurs when the resolution is ...

How can I align text vertically inside a button using HTML and CSS to ensure it is at the top?

Looking for a solution to a design issue I'm facing. You can view the situation here: jsfiddle <button type="submit"> <div class="icon"></div> </button> button { width: 250px; height: 250px; background: orange ...

Stop the removal of the CSS content property

When a user enters and re-enters their password, I have a form that checks the strength of the password and displays text accordingly. However, I noticed that if a user makes a mistake and uses the backspace to re-enter the password, the text from data-tex ...

Implementing Conditional Attribute Addition in Vue.js

When developing in vue, I encountered this scenario: <v-dialog v-model="data_table.dialog"> I have a variable called is_mobile that is observable. My goal is to modify the tag above based on the value of is_mobile. For instance: <v-dialog v-mod ...

External CSS file for Demandware platform

My boss was supposed to train me this year on demandaware knowledge, but ended up quitting, leaving me in the dark. I am scheduled to attend workshops later this year, but for now I am relying on Google and stackoverflow for guidance. Currently, I am wor ...

Utilizing Google's Text-to-Speech Service to Download Audio Files on the Front-end

I have a specific need to transform text into audio by utilizing Google Text to Speech. Currently, I am implementing Nodejs to convert the text into an audio file and aiming to transmit the audio result to the user interface. The NodeJS code snippet is a ...

Vertically align the content within a div

Here is what I have been working on: http://jsfiddle.net/yisera/2aVpD/ I am trying to vertically center a div inside the .jumbotron-special container. I attempted using display: table; on the parent element and then implementing display:table-cell on th ...

The issue of V-select's lack of compatibility with big integers is causing scalability problems

When a select list contains items with extremely large integers like 738883988997898200, clicking on it causes the options to hang on the screen, preventing further action. This issue arises because we are working within a v-form that is validating the fi ...

Flipped the dimensions of an image for better responsiveness

Trying to implement this particular design on a responsive website. Wondering if there's a way to establish an inverse resizing technique using jQuery / Javascript so that as the viewport shrinks, the text size increases. Attempted to use jQuery to a ...

Difficulty typing in Vuejs b-form-input component with v-model active

Currently, I am implementing a feature using a b-form-input in conjunction with b-form-datalist. The input text boxes will be generated dynamically, one per row. Initially, the datalist displays a few entries. When a value is selected, it gets added to a ...

Issues arising from using Android Studio in conjunction with Quasar framework

I am currently working with quasar and I attempted to start the project using these commands: quasar build -m capacitor -T android quasar dev -m capacitor -T android Unfortunately, when I entered the first command, I encountered this error: FAILURE: Build ...