Cover the entire page with a solid background color

Is there a way to extend the green color from top to bottom on the page? Also, how can I move the CRUD section to the left?

https://i.sstatic.net/pXxhl.png

I'm having trouble filling the entire page with the content.

Below is my code written in VueJS:

    <template>
    <div class="container-fluid">
        <h1>CRUD</h1>
        <div class="my-form col-xs-1">
            <b-card class="box">
                <b-form-group id="input-group-1">
                    <b-form-input
                            id="input-1"
                            required
                            placeholder="Username"
                    ></b-form-input>
                </b-form-group>
                <b-form-group id="input-group-2">
                    <b-form-input
                            id="input-2"
                            type="password"
                            required
                            placeholder="Password"
                    ></b-form-input>
                </b-form-group>
                <div class="btn">
                    <b-button variant="primary" >Login</b-button>
                    <b-button variant="success" @click="$router.push('/register')">Register</b-button>
                </div>
            </b-card>
        </div>

    </div>
</template>

<script>
    export default {}
</script>

<style scoped>
    .container-fluid {
        background-color: green;
        height: 100%;
    }

    .my-form {
        display: block;
        margin-top: 120px;
        margin-bottom: 120px;
    }

    .box {
        padding: 10px;
        margin-bottom: 20px;
    }

    .btn {
        margin: 5px;
    }
</style>

What am I doing wrong here? I attempted using flex but the content always just fits itself. Any advice would be much appreciated!

Pardon my imperfect English.

Thank you

Answer №1

All you need to do is add the following line in your body tag:

background-color: green;

Answer №2

Modify the background color using CSS and ensure that the document body is a minimum of 100% of the viewport height :

body {
  background-color: green;
  min-height: 100vh;
}

To left-align "CRUD", apply the Bootstrap utility class "text-left":

<h1 class="text-left">CRUD</h1>

https://getbootstrap.com/docs/4.3/utilities/text/

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

I'm wondering why myDivId.toggle() is functioning properly but myDivClass.toggle() is not working as expected

Using JQuery's toggle() function, I have been able to hide and show some DIVs successfully. Recently, I discovered relationships between certain DIVs that allowed me to group them into a class. I decided to try toggling the entire class rather than ...

Image missing aria-label attribute

I am facing an issue with getting the aria-label to display on my image. Despite checking my code, I cannot figure out why it is not working. Any ideas on what might be missing? Here is the code from my NextJS app: The svg in my public folder. <?xml v ...

What is the best way to display the complete text or wrap a menu item in an Angular Material menu?

Is it possible to display the full text of a menu item instead of automatically converting it to ellipses or breaking the word? I've tried various CSS methods without success. Any suggestions? https://i.stack.imgur.com/3l7gE.png #html code <mat-m ...

What is the best way to position the top line next to the border?

I've been attempting to create a falling line effect on the left side of the box's border, but I can't seem to figure out what's causing the issue. Below is the code snippet: @import url('https://fonts.googleapis.com/css ...

Stop the stacking of 'display:table' specifically on Android devices

I have created a social media menu with several different links. It displays correctly in Chrome, Safari, Firefox, and Internet Explorer on iOS devices, but on Android devices, the icons stack horizontally: Here is the HTML code: <ul id="menu-social"& ...

The <ul> tag is not receiving the correct styles and is not displaying properly

I have successfully integrated an input control and button into my table within the Angular 7 application. When a user inputs text in the control and clicks the add button, the text is appended to the <ul> list. However, the layout of the <ul> ...

Changing the boolean value for this.$refs.focus() in Vue.js: a guide

I'm trying to switch the focus using $refs, but I keep running into this error: [Vue warn]: Error in render: "TypeError: Cannot read property 'focus' of undefined" TypeError: Cannot read property 'focus' of undefined e ...

Design of website built on Bootstrap framework seems distorted on Firefox browser

I built this website with the help of Bootstrap and you can view it at js-projects. Everything looks great when I open it in Chrome or Safari, but there are weird white strips that resemble scroll bars when I view it in Firefox. Can someone assist me in ...

Guide to making control bar fade out when video is paused on video.js

Is there a way for the control bar to automatically disappear when the video is paused? Thank you in advance! ...

The mounted() lifecycle hook in Vue3 is getting invoked multiple times

Recently, I set up a vue template to display a table rendering all items from an array. Here's a snippet of what it looks like: <template> <thead> my table heads... </thead> <tr v-for="item in items" ...

Interactive Thumbnail Previews

There seems to be an issue with the thumbnail links on my page. The leftmost and rightmost links work fine, but the middle ones are not functioning properly when clicked. The PHP code used to generate these links is the same for all of them, so it's p ...

What is the best way to display a list of items in Vue JS while maintaining the

Looking to display my Vue.js list in reverse order using v-for without altering the original object. The default HTML list displays from top to bottom, but I want to append items from bottom to top on the DOM. Telegram web messages list achieves this wit ...

Updating the font color of rows using Vue.js and Vuetify

I want to change the font color of rows in a vuetify v-data-table based on a column called "color_status" from my backend. Although I have created a template for this purpose, it currently displays all fields instead of just the header fields. Is there a ...

Get Dark Mode up and running on Nuxt.Js

Looking to implement Dark Mode in my Nuxt.Js application powered by Vue.Js, allowing me to easily switch themes within the app. Utilizing Ant as my front-end framework, I previously reached out regarding options for modifying color vars but have yet to re ...

Alteration in relational shift of division placement

My webpage is divided into three sections with the following proportions: 15% - 65% - 20% In the right section, there is a div with the ID alchemy. I want to set the height of this div using <div style="height:150px;">. However, when I set the heig ...

What is the best way to relocate a form to the top of the page

I am creating a website to enhance my HTML skills, and I encountered an issue with the sign-in form. Whenever I try to place an image next to the form, it automatically moves to the bottom. I have attempted using padding-top and padding-bottom but to no av ...

Styling with CSS to show an image and text on the same line

I would like to show text and image on the same line, with the image slightly above the text. View Demo html img.del { display: inline-block; float: right; cursor: pointer; margin-right: 74% } .astext { text-align: left; margin-le ...

Print the page number using HTML and PHP

Is there a way to center page numbers in HTML? I have the code below that echoes the numbers, but they always appear on the left side of the page. I tried wrapping them in a div to center them, which worked, but then each number is enclosed in its own d ...

The value returned by $route.query.page is incorrect, or there may be an issue with type casting in the v-if condition

Currently, I am working on a posts page and the main focus is on pagination. I have developed a pagination component that has the following structure: <template> <nav aria-label="Pagination"> <ul class="pagination justify-cont ...

Encountering an issue in Laravel when trying to retrieve data using relationships and the paginate() method

When I try to fetch data using paginate(10), Vue.js does not work. However, if I use paginate(5), it works fine. The code in the Controller with relationships in the model files is working fine and returns a 200 OK response. $results = Posts::with([' ...