How to ensure that two rows in Vuetify evenly split the screen into two equal halves

I'm struggling with what seems like a simple task.

All I want is for the upper half of the v-main to be taken up by one v-row, and the lower half by another v-row. If the content of either row overflows, it should be scrollable.

You can view the MWE here: https://codepen.io/chapkovski/pen/abwPYda

The HTML structure is as follows:


<div id="app">
  <v-app id="inspire">
    <v-app-bar color="#6A76AB" dark app>
      &nbsp

    </v-app-bar>
    <v-main class='d-flex flex-column' app>
      <v-container fluid>
        <v-row class='yellow d-flex flex-column ' style='height:50%'>
          <v-col v-for='item in items'>{{item}}</v-col>
        </v-row>
        <v-row class='red' fill-height style='height:50%'>RED</v-row>
      </v-container>
    </v-main>
  </v-app>
</div>

For the CSS part:

.yellow {
  overflow-y: scroll;
  max-height:50%
}

And finally, the JavaScript code:


new Vue({
  el: "#app",

  vuetify: new Vuetify(),
  data: () => ({ items: _.range(1, 100) }),

  watch: {},
  methods: {}
});

Answer №1

If you want to adjust the layout for different screen sizes, you can utilize breakpoints as explained in this resource

For instance, in the following scenario, the column size will be set to 12 for small screens and 6 for larger screens, which equals half of the maximum size.

    <v-container class="grey lighten-5">
        <v-row no-gutters>
          <v-col cols="12" sm="12" md="6">
             a
          </v-col>
          <v-col cols="12" sm="12" md="6">
             b
          </v-col>
        </v-row>
      </v-container>

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

What is the best way to change a value in a list item when a different value in the same item is verified?

Within my code, I am working with an array of items that have different values. To simplify things, let's focus on just two values for this example: selectedFields() { return [ { message: '' showCheckMark: false ...

Troubleshooting: Issues with CSS fixed positioning

Whenever I try to scroll down, my navbar moves along with the page. Even when I resize the window, it keeps shifting despite using position:fixed. What mistake am I making? nav li:nth-child(1) { position: fixed; border: 1px solid #15317E; font-si ...

The dichotomy between public and private methods within a Vue.js component

Within a component, I have two functions defined. One is foo(), which is defined within <script>, and the other is fooExported(), which is defined in the body of export default {}. My understanding is that functions inside export default {} can be a ...

Achieving a layout with two rows containing two flexboxes on each row using Flexbox

Currently, I'm working on getting two flexboxes on each row. Here is the current layout: https://i.sstatic.net/UsAI6.jpg Here is the desired layout I'm aiming for: https://i.sstatic.net/wRhw4.jpg I want to have 4 flexboxes in total, with 2 on ...

Styling Iframe Borders with HTML and CSS: A Guide to Custom

Hello there, I am still learning the ropes of HTML and CSS and I have a question regarding styling a div with CSS to look like a default iframe in Internet Explorer. Despite my efforts and searches on Google, I haven't been able to achieve the desired ...

Is it necessary to include the Roboto font when using MUI?

After reviewing the Material UI documentation, it appears that users are responsible for loading the Roboto font: Material UI is designed to use the Roboto font by default. You may add it to your project with npm or yarn via Fontsource, or with the Googl ...

Guide to positioning a div at the bottom of a Drawer while maintaining the same width as the Drawer in React Material UI

Creating a Drawer on the right-hand side using <Drawer/>, I am trying to make a <div> stick to the bottom of the <Drawer />. The width of this <div> should match the width of the <Drawer />. Desired Outcome: https://i.sstati ...

Ensuring that the content fits perfectly inside a div using either Bootstrap or

I am facing an issue with two nested divs. One of them has a button that I want to stick to the bottom of the parent div, while the other contains text or a list of persons. The problem arises when the text is lengthy, causing it to overflow the div. I am ...

Tips for aligning buttons vertically within the form-row class in Bootstrap 4

I'm facing an issue where I cannot get a set of buttons in line with labels when using different column widths in Bootstrap. The behavior of a button assigned to a specific column width, like col-3, is not the same as a button assigned with automatic ...

Efficient segmentation of text using CSS and JavaScript

Currently, I'm involved in a project that allows users to create their own timelines with events. However, there seems to be an issue with the event titles. Users are able to create events with extremely long titles, such as: `1231231231231231231231 ...

Utilizing personalized CSS for specific ioslides

If I decide to stick with the default data and presentation of a new ioslides, changing only the second slide (## R Markdown) without affecting the entire item, how can I do this by setting up the css document accordingly? My goal is to simply adjust the f ...

Creating a sleek and modern web application using Laravel 5 and Vue JS

Using Vue JS in my Laravel 5 application is causing a blank page to appear when I use v- new Vue({ el: '#vApp', data: { todos: [ { text: 'Learn JavaScri ...

The minimum height property in CSS seems to be ineffective on Firefox, but it functions properly on Internet Explorer

Within my facelets template, there is a div with a specified minimum height. However, this does not seem to be functioning correctly in the Firefox browser. <div class="body"> <table> <tr> <td v ...

Experimenting with Jquery hyperlinks beyond the realm of Google Chrome

Is there a way to verify a jQuery link without relying on the inspect element feature in Google Chrome? I initially thought that was the issue because the links failed to load, but even after correcting it, the show function still does not perform the anim ...

Ensure the video fills the entire width of its parent element and adjusts its height accordingly to maintain a 16:9

I am looking to make both videos fill 100% width of their parent element while keeping their aspect ratio intact. The parent element takes up 50% of the window's width, so the videos need to be responsive. I have come across numerous solutions that ...

Error encountered in scss file with Rollup, Vue, and Buble: unexpected token detected

I am encountering an issue while attempting to compile SFC with rollup, using Vue and Buble, following the example provided on the official Vue page. Despite my efforts, I keep running into the following error: src/wrapper.js → dist/chat.min.js... [!] ( ...

A step-by-step guide on how to capture user input in Vue.js after the "

Is there a way to capture the character entered after a key is pressed or after the user presses the enter key? I tried using the npm package npm i vue-keypress, but I couldn't figure out how to capture the characters. Can you suggest another method ...

Tips for avoiding background-image zoom on mobile browsers when stacking elements vertically:

Within my ReactJS application, I have implemented a feature where elements are added vertically from top to bottom when the "Post" button is clicked. https://i.sstatic.net/KwPYV.jpg These elements display correctly on both mobile and desktop browsers. Ho ...

"Encountering a Challenge with Setting Up Forms on

I've recently started learning to code and I'm facing an issue with my form appearing stretched out. You can view it here: I initially thought it was due to margins, so I increased them. Then, I tried adjusting the width to 50%, but that didn&ap ...

Is there a way to identify if you are at the bottom row of a column defined by CSS styling?

I have implemented the new CSS-style column to divide a single unordered list into multiple columns. Now, I am trying to figure out how to target the last element in each column using JavaScript or CSS. Here is my HTML: <ul> <li /> <li ...