HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Learn how to create a responsive zig zag (alternating) layout with CSS
Step 1) Add HTML:
<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>
Step 2) Add CSS:
* {
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 »