Make the Vuetify v-card adjust to the maximum height within a v-col

I am currently developing a login/signup page using Vue and Vuetify. Below is the code I have written for the page (the text is in Italian since I am Italian, but the concept is universal):

<v-row 
      align="center"
      justify="center"
      class="prova"
    >
        <v-col
        cols="10"
        lg="3"
        md="4"
        sm="5"
        >
          <v-card
          >
            <v-card-title class="center">
              Login
            </v-card-title>

            <v-card-text
              class="center"
            >
              <v-container>
                <v-form>
                  <v-text-field
                    label="Email"
                    required
                  ></v-text-field>

                  <v-text-field
                    :append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'"
                    :type="showPassword ? 'text' : 'password'"
                    label="Password"
                    counter
                    @click:append="showPassword = !showPassword"
                  ></v-text-field>

                  <v-btn
                    color="primary"
                  >
                    Log in
                  </v-btn>
                </v-form>
              </v-container>
            </v-card-text>
          </v-card>
        </v-col>
        <v-col
        cols="10"
        lg="3"
        md="4"
        sm="5"
        fill-height
        >
          <v-card
          >
            <v-card-title class="center">
              Registration
            </v-card-title>

            <v-card-text class="center">
            <v-container >
              <div
              >Want to access the site 
                but you're not registered yet? 
                Click below 
                to sign up now!</div>
              <br>
              <v-btn
                color="primary"
              >
                Sign up
              </v-btn>
            </v-container>
            </v-card-text>
          </v-card>
        </v-col>
    </v-row>

When implementing this code, I noticed that the "Sign up" card has a different height than the Login card. Is there a way, preferably using CSS or JavaScript, to make both cards equal in height for better aesthetics?

Thank you! Have a wonderful day!

Answer №1

Take a look at the codesandbox I created: https://codesandbox.io/s/stack-70836234-11sck?file=/src/components/CardHeight.vue

Simply remove the align="center" from your v-row. Then, just add the CSS height:100% to your v-card

UPDATE: If you want to set a fixed height for the v-card specifically on mobile view, you can utilize Vuetify's display breakpoints. In this scenario, I have applied them to the style attribute, but it can be used with any HTML attribute and in any JavaScript context.

<!-- Card 1 -->
<v-card :style="$vuetify.breakpoint.xsOnly ? 'height: 280px' : ''">
...
</v-card>

<!-- Card 2 -->
<v-card :style="$vuetify.breakpoint.xsOnly ? 'height: 280px' : 'height:100%'">
...
</v-card>

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

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

Having trouble with the last child not appearing after in Chrome? Is there a problem with the pseudo-element usage?

Encountering a peculiar issue specific to Chrome (no problems in FF and Safari, not concerned about IE) that raises questions regarding whether it's a bug, incorrect usage of pseudo elements, or the compatibility of combining pseudo classes and pseudo ...

Could the inner object's value be retrieved from the wrapper object in a Vuex getter prior to mounting?

Currently grappling with a challenge while working on Vuex and VueJS involving the Computed property. To sum it up, I have a nested object within the Vuex state, attempting to retrieve a key from this inner object in a Vuex getter to display the value in ...

Error: The variable usersWithSecrets has not been declared and therefore is not defined within the current scope. This issue

Despite my best efforts, I keep encountering the same error repeatedly: ReferenceError: D:\Secrets - Starting Code\views\submit.ejs:8 6| <h1 class="display-3">Secrets</h1> 7| >> 8| <%usersWith ...

The ideal method to transmit reactive data effectively is through Vue.js

Implementing vue.js. I've created an authentication file (auth.js) that stores the user information upon detecting a change in authentication state. There are other sections of the website that need to update when the user information changes. What is ...

Generating observables from form submission event

Note: I am completely new to Angular and RXJS. Currently, I am working on a simple form where I want to create an observable. The goal is to listen for submit events and update a value within the component. However, I keep encountering an error message sa ...

Why is Component scope not binding in AngularJS?

I encountered a problem and have set up a JSFiddle to showcase var myApp = angular.module("myApp", []); myApp.component("bar", { transclude: true, template: '<div ng-transclude></div>', controller: function ($scope, $elem ...

Add the CSS code to the <head> section, even though the CSS styles are located within

According to the analysis from Webpagetest.org, it appears that The CSS for http://mypage.com/howitworks is located in the document body: The link node for http://mypage.com/design_header.css should be relocated to the document header. The design_header ...

What tool can be used for formatting and syntax highlighting when working with ejs (embedded javascript) templates?

When working on my project, I utilize EJS as the express templating engine. While it is user-friendly and efficient, I have encountered difficulties when it comes to editing files - the text highlighting could be better, and I have not been able to find an ...

What are some effective methods for preventing CodeMirror from appearing as a blank white box upon initialization?

In my project with Codemirror version 5.62.3 and the 'monokai' theme set to a dark background, I am facing an issue where upon reloading the page, the CodeMirror initializes as a small white box before the proper styling is applied. I have attemp ...

I struggle to grasp the significance of the scene's positioning

I've been experimenting with some sample code using three.js, where I've created a plane and I want it to rotate around. Here's a snippet of my code: This is the setup for my camera: var camera = new THREE.PerspectiveCamera(70, window.inner ...

Issues with HTML Labels disrupting Bootstrap Grid Columns layout

Here is the HTML code I am working with: <div class="row"> <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3"> @*@Html.LabelFor(s => s.BasicInfo.FirstName)*@<label>First Name:</label> </div> <div clas ...

What could be causing the issue with the <bgsound src="music/binks.mp3"/> not functioning properly?

Looking to add some background music to my website, but struggling to find current information after searching for 15 minutes. Can anyone provide assistance? <body> <bgsound src="music/binks.mp3"/> </body> <bgsound src=& ...

What is the process for exporting/importing a variable in Node.js?

What is the correct way to export/import a variable in Node.js? I attempted to use export and import methods, but I received an error message stating that it should be a module. After changing the type to module in the JSON file, it then told me that requ ...

Implement seamless content loading using jQuery, eliminating the need

Is there a reason why this piece of code isn't working for me? I'm trying to load HTML content using jQuery and followed the instructions from this tutorial: Here's how my HTML looks: <div id="icon"> <a href="http://localhost/ ...

Are you interested in removing a user account?

As a newcomer, I'm attempting to delete a profile but keep encountering this message in the address bar: http://thexyz.com/the/delete.php?id=1> I'm wondering if I've made a syntax error in my code below- <?php $i=1; while( ...

Ways to retrieve the value of the chosen radio button using Prototype or JQuery

Looking for a way to retrieve the value of the selected radio button using either JQuery or Prototype? Check out this sample form: <label for="deliveryChoice">Courier&nbsp;<b>&pound;3.00</b></label> <input type="radio" ...

"The controller's $scope isn't being updated within the DIV following a routing change

My website contains ng-view partials that change based on routing updates in $routeProvider. anmSite.config(function($routeProvider, $locationProvider){ $locationProvider.html5Mode(true); $routeProvider //Home page route .when("/", { temp ...

locate a text within a script element

I am looking to extract a JavaScript script from a script tag. Below is the script tag I want to extract: <script> $(document).ready(function(){ $("#div1").click(function(){ $("#divcontent").load("ajax.content.php?p=0&cat=1"); ...

Spacing between navigation links appears to be too wide on WordPress

Check out our website: I am facing an issue with aligning all my links in a single line on my menu. Currently, there is too much spacing between each link causing them to wrap onto the next line. Here is what I have so far. https://i.sstatic.net/YaHbJ.jp ...

PHP loop that generates gaps between the buttons

My current challenge involves using a while loop to dynamically generate buttons based on the `outcomeId` count. However, I am facing an issue where the buttons created by the loop have gaps between them. <div class="outcomes"> <?php ...