title: angular flex layout grid system
body: <p><a href="https://i.stack.imgur.com/hlF00.jpg" rel="noreferrer">Click to view attacted image</a></p>
  
  <p>I want to make screen like the attached image, but getting some issue. My code is working fine for Small devices and Large devices, but for Medium devices it's not working fine. So can anyone look into my code and help me to solve this issue. 
  Actually, I am little confused with Flex layout grid system. It's very easy to achieve this in Bootstrap, but I want same in Flex Layout. </p>
  
  <pre><code>    &lt;div fxLayout="row" fxLayout.sm="column" fxLayout.xs="column" fxLayoutAlign.lg="start center"
       fxLayoutAlign.xs="center center" fxLayoutAlign.sm="center center"&gt;
  
    &lt;div fxFlex="25%" fxFlex.md="50%" fxFlex.sm="100%" fxFlex.xs="100%" fxLayout.md="row"
         class="pading_card"&gt;
      &lt;mat-card class="example-card"&gt;
        &lt;mat-card-header&gt;
          &lt;div mat-card-avatar class="example-header-image"&gt;&lt;/div&gt;
          &lt;mat-card-title&gt;Shiba Inu&lt;/mat-card-title&gt;
          &lt;mat-card-subtitle&gt;Dog Breed&lt;/mat-card-subtitle&gt;
        &lt;/mat-card-header&gt;
        &lt;img mat-card-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Photo of a Shiba Inu"&gt;
        &lt;mat-card-content&gt;
          &lt;p&gt;
            The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan.
            A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally
            bred for hunting.
          &lt;/p&gt;
        &lt;/mat-card-content&gt;
        &lt;mat-card-actions&gt;
          &lt;button mat-button&gt;LIKE&lt;/button&gt;
          &lt;button mat-button&gt;SHARE&lt;/button&gt;
        &lt;/mat-card-actions&gt;
      &lt;/mat-card&gt;
    &lt;/div&gt;
  
    &lt;div fxFlex="25%" fxFlex.md="50%" fxFlex.sm="100%" fxFlex.xs="100%" class="pading_card"&gt;
      &lt;mat-card class="example-card"&gt;
        &lt;mat-card-header&gt;
          &lt;div mat-card-avatar class="example-header-image"&gt;&lt;/div&gt;
          &lt;mat-card-title&gt;Shiba Inu&lt;/mat-card-title&gt;
          &lt;mat-card-subtitle&gt;Dog Breed&lt;/mat-card-subtitle&gt;
        &lt;/mat-card-header&gt;
        &lt;img mat-card-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Photo of a Shiba Inu"&gt;
        &lt;mat-card-content&gt;
          &lt;p&gt;
            The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan.
            A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally
            bred for hunting.
          &lt;/p&gt;
        &lt;/mat-card-content&gt;
        &lt;mat-card-actions&gt;
          &lt;button mat-button&gt;LIKE&lt;/button&gt;
          &lt;button mat-button&gt;SHARE&lt;/button&gt;
        &lt;/mat-card-actions&gt;
      &lt;/mat-card&gt;
    &lt;/div&gt;
  
    &lt;div fxFlex="25%" fxFlex.md="50%" fxFlex.sm="100%" fxFlex.xs="100%" class="pading_card"&gt;
      &lt;mat-card class="example-card"&gt;
        &lt;mat-card-header&gt;
          &lt;div mat-card-avatar class="example-header-image"&gt;&lt;/div&gt;
          &lt;mat-card-title&gt;Shiba Inu&lt;/mat-card-title&gt;
          &lt;mat-card-subtitle&gt;Dog Breed&lt;/mat-card-subtitle&gt;
        &lt;/mat-card-header&gt;
        &lt;img mat-card-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Photo of a Shiba Inu"&gt;
        &lt;mat-card-content&gt;
          &lt;p&gt;
            The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan.
            A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally
            bred for hunting.
          &lt;/p&gt;
        &lt;/mat-card-content&gt;
        &lt;mat-card-actions&gt;
          &lt;button mat-button&gt;LIKE&lt;/button&gt;
          &lt;button mat-button&gt;SHARE&lt;/button&gt;
        &lt;/mat-card-actions&gt;
      &lt;/mat-card&gt;
    &lt;/div&gt;
  
    &lt;div fxFlex="25%" fxFlex.md="50%" fxFlex.sm="100%" fxFlex.xs="100%" class="pading_card"&gt;
      &lt;mat-card class="example-card"&gt;
        &lt;mat-card-header&gt;
          &lt;div mat-card-avatar class="example-header-image"&gt;&lt;/div&gt;
          &lt;mat-card-title&gt;Shiba Inu&lt;/mat-card-title&gt;
          &lt;mat-card-subtitle&gt;Dog Breed&lt;/mat-card-subtitle&gt;
        &lt;/mat-card-header&gt;
        &lt;img mat-card-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Photo of a Shiba Inu"&gt;
        &lt;mat-card-content&gt;
          &lt;p&gt;
            The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan.
            A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally
            bred for hunting.
          &lt;/p&gt;
        &lt;/mat-card-content&gt;
        &lt;mat-card-actions&gt;
          &lt;button mat-button&gt;LIKE&lt;/button&gt;
          &lt;button mat-button&gt;SHARE&lt;/button&gt;
        &lt;/mat-card-actions&gt;
      &lt;/mat-card&gt;
    &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>