How TO - Responsive Zig Zag Layout

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





googletag.cmd.push(function() googletag.display('div-gpt-ad-1422003450156-2'); );



How TO - Responsive Zig Zag Layout



❮ Previous
Next ❯


Learn how to create a responsive zig zag (alternating) layout with CSS.



Try it Yourself »




How To Create a Zig Zag Layout



Step 1) Add HTML:


Example



<div class="container">
  <div class="row">
    <div
class="column-66">
      ...
   
</div>
    <div class="column-33">
     
...
    </div>
  </div>
</div>

<div
class="container">
  <div class="row">
    <div
class="column-33">
      ...
   
</div>
    <div class="column-66">
     
...
    </div>
  </div>
</div>








googletag.cmd.push(function() googletag.display('div-gpt-ad-1493883843099-0'); );





Step 2) Add CSS:


Example



*
  box-sizing: border-box;


.container
 
padding: 64px;


/* Clear floats */
.row:after
  content: "";
 
display: table;
  clear: both


/* 2/3 column */

.column-66
  float: left;
  width:
66.66666%;
  padding: 20px;


/* 1/3 column */
.column-33

  float: left;
  width:
33.33333%;
  padding: 20px;


/* Add responsiveness - make
the columns appear on top of each other instead of next to each other on small
screens */
@media screen and (max-width: 1000px)
  .column-66,
  .column-33
   
width: 100%;
    text-align: center;
 

Try it Yourself »


Tip: Go to our CSS Website Layout Tutorial to learn more about
website layouts.


Tip: Go to our CSS Responsive Web Design Tutorial to learn more about
responsive web design and grids.





❮ Previous
Next ❯

Popular posts from this blog

WWE Night of Champions

Poznań

Kaliningrad