The section cannot be shown in a flex layout within a grid container

My goal is to showcase a grid layout containing multiple sections within a div, but I'm encountering an issue where the sections are only displaying as blocks. I am seeking assistance in making the second portion of the data appear flexed. Currently, when attempting to set the Class locationInfo div to display flex, it doesn't have any effect.

I would like the layout to resemble this:

However, at present, it looks like this:

Below is the code snippet for my component:

<template>
  <div id="mainDiv">

        <div id="locationInfo">
               <!-- left detail section -->
            
                  <div>
                    <section>
                    <p><b>NYC</b></p>
                    <small>7:35</small>
                    </section>
                  
                  <section>
                    <img src='../assets/svg/flight.svg' height="40px" width="40px"/>
                    <small>10/12/20</small>
                    </section>
                
                <section>
                    <p><b>SYD</b></p>
                    <small>10:45</small>
                  </section>

                      <div id="AirlinesDetails">
               <img src="../assets/svg/home/logo-2.svg" height="40px" width="40px" />
                  <section>
                    <b><p>Turkish Airlines</p></b>
                    <small>cx511 | Airbus 333</small>
                  </section>
                  <section>
                    <p>2 Stop</p>
                    <small>3h 58min</small>
                  </section>
                </div> 

             </div>
        



        <!-- second row-->
                  <div>
                    <section>
                      <h4>NYC</h4>
                      <small>7:35</small>
                    </section>

                    <section>
                      <img src='../assets/svg/flight.svg' height="40px" width="40px"/>
                      <small>10/19/20</small>
                    </section>
                 
                    <section>
                    <h4>SYD</h4>
                    <small>10:35</small>
                    </section>

                        <div id="AirlinesDetails">
               <img src="../assets/svg/home/logo-2.svg" height="40px" width="40px" />
                  <section>
                    <b><p>Turkish Airlines</p></b>
                    <small>cx511 | Airbus 333</small>
                  </section>
                  <section>
                    <p>2 Stop</p>
                    <small>3h 58min</small>
                  </section>
                </div>
                
              </div>
              </div>
        
       

        </div>
    
  </div>
</template>


<style scoped>
#modal-1{
  border: none;
...

Answer №1

Check out this potential solution using flexbox and see if it suits your needs.

 <div class="flight-container">
      <section class="flight">
        <div class="flight-info">
          <div>
            <h4>NYC</h4>
            <p><small>7:35</small><p>
          </div>
          <div>
          <img src='../assets/svg/flight.svg' height="40px" width="40px"/>
          <p><small>10/19/20</small></p>
        </div>
          <div>
          <h4>SYD</h4>
          <p><small>10:35</small></p>
        </div>
        </div>
        <div class="flight-info">
          <div>
            <div class="row">
              <div>
                <img src="../assets/svg/home/logo-2.svg" height="40px" width="40px" />
              </div>
              <div>
                <strong>Turkish Airlines</strong></b>
                <p><small>cx511 | Airbus 333</small><p>
              </div>
            </div>
          </div>
          <div>
            <h4>2 Stop</h4>
            <p><small>3h 58min</small></p>
          </div>
        </div>
      </section>
      <section class="flight">.....</section>
    </div>

CSS

.flight-container{
  display: flex;
}
.flight{
  width: 50%;
}
.flight-info{
  display: flex;
  justify-content: space-between;
}
.row{
  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

having difficulty placing 3 pop-up windows on a single page

Struggling to implement multiple popups on my page, each with a unique ID assigned. Any assistance would be greatly appreciated. Here is the code snippet: .fa { font-size: 50px; cursor: pointer; user-select: none; } .fa:hover { font-size:20px; t ...

Issues with audio and video playback intermittently occurring on Sencha Touch 2

As a beginner with Sencha Touch 2, I am currently working on uploading images onto an iPad using Xcode. My app has audio playing on the home screen, and I want the video to start playing and the audio to stop when a specific tab is selected. However, the ...

Webpack2 now transforms sass/scss files into JavaScript rather than CSS during compilation

I've created a webpack script to compile all .scss files into one css file. I decided to use webpack instead of gulp or grunt for simplicity, as it can be configured in a single file. However, I am encountering an issue where scss files are being com ...

A plug-in for TinyMCE that allows users to adjust column widths within a table

We utilize TinyMCE in our content management system (CMS), and our users have expressed interest in being able to adjust the width of a column within a table. While HTML technically does not recognize columns, the Moodle editor HTMLAREA includes a plugin t ...

Border utilities in Bootstrap 4 provide easy ways to add borders

I have been searching for a solution, but I can't seem to find it. Bootstrap 4 offers utility classes for adding and removing borders, but is there a way to define the border width or style like solid or dashed? <span class="border"></span&g ...

Implementing dual pagination components in Vue JS for dynamic updates on click

Having two pagination components on a single page is convenient for users to navigate without scrolling too much. One component is placed at the top and the other at the bottom. The issue arises when I switch to page 2 using the top component, as the bott ...

How to create a floating <Toolbar/> with ReactJS, Redux, and Material-UI

Can anyone help me figure out how to make a toolbar floatable when scrolling down using Material-UI? I tried setting textAlign:'center', position: 'fixed', top: 0, but it's resizing strangely when applied to the <Toolbar/>. ...

"Embracing Flexbox for a fully responsive mobile experience

What's the best way to make this flexbox design responsive for mobile devices? I want the layout to look consistent across both desktop and mobile screens. The issue seems to be related to the responsiveness of the flexbox and the smaller size of mobi ...

transforming unicode into regular characters prior to being presented on a webpage

I am currently utilizing the openinviter class to import contacts from emails. Sadly, it is showing Unicodes of non-English characters, like Polish, such as u0117 (and similar code types), instead of regular characters. Is there a way to convert these Unic ...

Stacked divs needed to be aligned vertically

Is there a way to make the head and main tabs fixed vertically one below the other? Keep in mind that these need to be separate angular components and cannot be combined under another div. The rows also need to be scrollable. .pages { float: left; ...

How to automatically choose the first option in a v-for loop in Vue.js

I have a loop that creates a dropdown menu from an array: <select class="form-control" v-model="compare_version" > <option v-for="(version, index) in allVersions" v-bind:value="index" v-bind: ...

Prevent Click Event on Angular Mat-Button

One of the challenges I'm facing involves a column with buttons within a mat-table. These buttons need to be enabled or disabled based on a value, which is working as intended. However, a new issue arises when a user clicks on a disabled button, resul ...

What is the best way to position a static element next to a Vue draggable list?

I'm currently working on implementing a feature to display a list of draggable elements using vue-draggable. These elements are occasionally separated by a fixed element at specified position(s). My approach so far has involved creating a separate el ...

Creating a custom directory structure for specific types of files in Vue Cli 3 build

Recently, I started using Vue to create web applications. When I use npm run build, it generates the following structure: https://i.stack.imgur.com/RWp4H.png However, I have a specific layout in mind that I want to achieve: https://i.stack.imgur.com/79S ...

Turning off and on CSS transitions to set the initial position

Is there a way in javascript to position divs with rotations without using transitions initially for an animation that will be triggered later by css transition? I have tried a codepen example which unfortunately does not work on the platform but works fin ...

Can you explain the functionality of the combination selector "AB," where "A" and "B" represent any selectors?

I've been delving into the concept of the "combination selector" by referring to resources on MDN. This selector involves selecting elements that match both criteria A and B simultaneously when they are placed together. Can someone shed some light on ...

Determine whether the user has scrolled past a specific threshold

Is there a way to display the button with the id backtotop only when the user has scrolled more than 250 pixels? This is my code: <template> <div> <button v-if="checkScroll" class="goTop" @click="backToT ...

What is the method for identifying modules that rely on a specific module?

Is it possible to view all dependencies modules of a specific module, similar to this: npm-remote-ls <module-name> But how can we see the modules that depend on a particular module? Any help would be appreciated. Thank you. ...

Exploring search capabilities within D3 graph nodes

After creating a JSON file with four tiers and utilizing D3.js's collapsing box format to visualize it (source: https://bl.ocks.org/swayvil/b86f8d4941bdfcbfff8f69619cd2f460), I've run into an issue. The problem stems from the sheer size of the J ...

Alter the border hue of the checkbox and radio button

Is there a way to modify the border color of checkboxes and radio buttons (both circle and rectangle) using CSS? I've attempted several methods with no success. Can someone provide guidance on this? Any advice would be greatly appreciated. Thank you ...