Skip to content

Commit

Permalink
add float-based example
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Kunka committed Dec 8, 2016
1 parent 2d6155d commit 38ae4bc
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
23 changes: 23 additions & 0 deletions demos/grid-floats/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">

<link href="../reset.css" rel="stylesheet"/>
<link href="./style.css" rel="stylesheet"/>

<title>MixItUp Demo - Float-based Grid</title>
</head>
<body>
<div class="container">
<div class="mix"></div>
<div class="mix"></div>
<div class="mix"></div>
<div class="mix"></div>
<div class="mix"></div>
<div class="mix"></div>
<div class="mix"></div>
<div class="mix"></div>
</div>
</body>
</html>
73 changes: 73 additions & 0 deletions demos/grid-floats/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
html,
body {
height: 100%;
background: #f2f2f2;
}

*,
*:before,
*:after {
box-sizing: border-box;
}

/* Container
---------------------------------------------------------------------- */

.container {
padding: 1rem .5rem;
overflow: hidden;
}

/* Target Elements
---------------------------------------------------------------------- */

.mix {
float: left;
margin: 0 .5rem 1rem;
background: #fff;
border-radius: 2px;
position: relative;
}

.mix:before {
content: '';
display: inline-block;
padding-top: 56.25%;
}

/* Grid Breakpoints
---------------------------------------------------------------------- */

/* 2 Columns */

.mix {
width: calc(50% - 1rem);
}

/* 3 Columns */

@media screen and (min-width: 541px) {
.mix {
width: calc(100%/3 - 1rem);
}
}

/* 4 Columns */

@media screen and (min-width: 961px) {
.mix,
.gap {
width: calc(100%/4 - 1rem);
}
}

/* 5 Columns */

@media screen and (min-width: 1281px) {
.mix,
.gap {
width: calc(100%/5 - 1rem);
}
}


1 change: 1 addition & 0 deletions demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ <h2>Grids</h2>
<ul>
<li><a href="./grid-inline-block/">Inline-block Grid (HTML/CSS only)</a></li>
<li><a href="./grid-flex-box/">Flex-box Grid (HTML/CSS only)</a></li>
<li><a href="./grid-floats/">Float-based Grid (HTML/CSS only)</a></li>
<li><a href="./grid-flex-box-matching-heights/">Flex-box Grid with Matching Heights</a></li>
</ul>
</body>
Expand Down

0 comments on commit 38ae4bc

Please sign in to comment.