0

Im not very much familiar with flex box but i assumed the following would give me the result i need,i need to give left side of the page to items(cards)but the way they position should be next together :

div class="flexContainer">

    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
    <mat-card  class="turbineIcons"></mat-card>
  </div>

here is my class for the main div:

  .flexContainer{
     width: 50%;
                }

  .turbineIcons{               
          background-color:white;
          margin: 1em;
          height: 20px;
          width: 20px;
      }

this shows all the items verticaly placed on the left side of the page

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701

2 Answers2

0

You haven't defined the flex properties.

Add this:

.flexContainer {
   display: flex;
   width: 50%;
 }
Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
0

Try adding to the css of you flex-container:

flex-wrap: wrap;
Erica T.
  • 430
  • 3
  • 9