Creating a split background with dual hues in a VUE project

I'm new to learning VUE and I'm trying to create a page where two different colors connect on the left and right with the same height. However, I'm running into issues where the colors don't align unless I add content to the right side.

I've tried using relative positioning and floating elements left and right, but it hasn't worked as expected.

I'm looking for a solution that doesn't involve using gradient colors or pseudo-elements like ::before or ::after.

<template>
  <div class="a">
    <div class="b">
      <div class="v1">
        <img src="../assets/v.png"/>
      </div>
      <div class="v2">
          <img src="../assets/v.png"/>
      </div>
      <div class="v3">
          <img src="../assets/v.png"/>
      </div>
      <div class="v4">
          <img src="../assets/v.png"/>              
      </div>
    </div>

    <div class="c">
      <div class="v5">
        <img src="../assets/v.png"/>  
      </div>
      <div class="v6">
        <img src="../assets/v.png"/> 
      </div>
    </div>
  </div>
</template>

<style>
  .a{
    margin: 0%;
    /* background: linear-gradient(top, red ,red 50%,blue 50%,blue); */
  }
  .b{
    float: left;
    background-color: antiquewhite;
    width: 30%;
    height: 100%;
  }
  .c{
    float: left;
    background-color:red;
    width: 70%;
    height: 100%;
  }

</style>

view image description here

Answer №1

make sure to specify the display property for .main as shown below:

.main{
  display : flex;
}

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

The scroll bar remains hidden even though there are additional elements waiting to be displayed

I am currently utilizing asp.net along with entity framework 4 On my page, I have three tabs structured like this: The Challenge I'm Facing The issue I am encountering is that the browser fails to display a scrollbar even when there are over 150 ro ...

Using V-model with Vue3 Web Components

I am trying to develop a web component using Vue3 to handle inputs and forms. However, I am encountering issues with two-way data binding. I have included the web component in my HTML page. <vue-input-text id="sample_input" name="sample_i ...

Arranging h1 tags within a container id

Seeking assistance with aligning specific classes in a certain way: "left" should align to the left part of #header, "links" should be centered, and "right" should align to the right of #header. Additionally, I want the icons to align vertically with the t ...

Utilize jQuery to animate the hiding of my right sidebar

Looking for help with implementing a jQuery animation to hide the right sidebar on my 3-columns page. I created a demo online here - JsFiddle: http://jsfiddle.net/yhfXX/ In my template, the columns are arranged as follows: menu (on the left) is fixed co ...

Using the combination of Chrome browser, Lucida Grande font, and word-wrap

Recently, I encountered a unique situation in Chrome where an odd combination of styles led to an issue. To help illustrate the problem, I created a fiddle which can be viewed here: http://jsfiddle.net/C3CbF/1/ This particular issue is only visible if you ...

Hide the paragraph element when the navigation link is being hovered over

Is there a way to hide a <p> element when hovering over a link? My website is built with Drupal and uses the Superfish module for the navigation bar. When I hover over the links, a secondary nav bar drops down. I want the slogan of the website to di ...

Vuejs Error: A rule is limited to having only one resource source, which includes provided resource, test, include, and exclude

I am currently working on a Vue.js project and recently had to reinstall the npm node module. After running NPM INSTALL and attempting to start the development server, I encountered a series of errors. I tried deleting the node_modules and package.json.l ...

The functionality of the jQuery .click method appears to be malfunctioning within the Bootstrap

It seems like my JQuery.click event is not functioning as expected when paired with the corresponding button. Any ideas on what might be causing this issue? Here's the HTML CODE snippet: <button id="jan7" type="button" class="btn btn-dark btn-sm"& ...

Collapsed Bootstrap navigation bar on mobile devices

Hello everyone, I am currently using the latest version of Bootstrap for my website. However, I have encountered an issue where the navigation collapses on mobile view. Could anyone provide assistance? Website: Below is a snippet of my HTML code: <he ...

What are the best methods for customizing the backgrounds of the form-floating input labels in the latest version of Bootstrap?

I'm currently using Bootstrap 5.3 and experimenting with the new "floating labels" feature. I want to add some extra styling to my input fields, like background colors. However, when I initially set a subtle green background color, it looks fine witho ...

What is the process behind the creation of the class or id fields in HTML for Gmail and Quora? How are these

When using Gmail: <tr class="zA yO" id=":1t4"> While on Quora: <span id="ld_zpQ1Cb_27965"> What is the purpose behind this and what specific tool do they employ to achieve it? ...

I have implemented a custom-built sidebar component and I'm unsure about the process of adding data to it

After successfully incorporating this SideBar into my Vuex/Laravel project, I encountered a problem. The example code provided used: <div :class="$style.sidebar"/> However, when I tried to modify it to: <div :class="$style.sidebar">Content&l ...

HTML unique flex wrapping

https://i.sstatic.net/ekVr4.png #menu { display: flex; justify-content: space-evenly; align-items: center; margin: 0 5px 0 5px; height: 30px; flex-wrap: wrap; } .menu_item { margin: 0 10px 0 10px; } .menu_item2 { margin: 0 10px 0 10px; } <div id="m ...

Issues with importing Storybook and Sass files are causing complications

Recently, I embarked on a project using Vue 3 and Storybook. As I started adding stories for my components, I encountered errors related to my styles. Seeking guidance, I turned to the official Storybook documentation and followed the instructions provided ...

Connecting Vue.js components together

I have two separate components - one for viewing data and another for editing the same data. The viewing component contains labels and paragraphs, while the editing component includes inputs and textareas. Both components are fed the same data object. Is ...

Vue.js HTTP POST request not correctly sending object data

I created a Vue.js App that looks like this var vueCommentApp = new Vue({ el: '#Commentdiv', data: { newComment:{"userCommentID":0,"siteurlID":1,"userId":"","userName":"Guest","commentPageT ...

Looking to enhance the size of pagination icons for previous and next pages on a Material-UI React table?

I am looking to adjust the size of the previous page and next page icons in a material table implemented in React. Below is the code snippet: localization = { { body : {} , toolbar: { searchTooltip: 'Search'} , pagination: ...

How can I incorporate classes from multiple CSS files into my WordPress theme?

Currently, I am utilizing wp_enqueue_style to incorporate two CSS files within a single function. However, the issue that arises is when I try to apply a class, it seems that only classes from one of the files can be utilized and it ends up overriding anot ...

Use Flexbox hover effect to display submenu text exclusively in the column being hovered

Having an issue with a 5 column flexbox. Each box should display a header text and supplementary text only when hovered over, returning to normal when unhovered. I was able to accomplish this in Codepen (view the rough model here). However, when trying to ...

Error: The modal function is not recognized by the window.$() method

The index.html file for my Vue.js project looks like this: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="w ...