Minimal grid system with media query and navigation.
by makzan
HTML
<header id='top' class='row'>
<div class='four col'>
<h1><img src='http://placehold.it/50x50' />Big Title Here</h1>
<p class='show-when-small'><a href='#footer-nav'>Navigation</a></p>
</div>
</header>
<div class='row main-nav'>
<nav class='four col'>
<ul>
<li><a href='#'>Link Here</a></li>
<li><a href='#'>Link Here</a></li>
<li><a href='#'>Link Here</a></li>
<li><a href='#'>Link Here</a></li>
<li><a href='#'>Link Here</a></li>
<li><a href='#'>Link Here</a></li>
</ul>
</nav>
</div>
<div class='row'>
<div class='three col'>
<p><img src='http://placekitten.com/800/600' alt='kitten'/></p>
<p>3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text </p>
<p>3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text </p>
<p>3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text </p>
<p>3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text 3 col text </p>
<div class='row'>
<div class='one col'>Login</div>
<div class='three col'>
<input type='text'>
<input type='text'></input>
<input type='submit' value='Login'>
</div>
</div>
</div>
<div class='one col'>
<p>1 col</p>
<p>1 col</p>
<p>1 col</p>
<p>1 col</p>
</div>
</div>
<footer class='row'>
<nav id='footer-nav' class='four col'>
<ul>
<li><a href='#'>Link Here</a></li>
<li><a href='#'>Link Here</a></li>
<li><a href='#'>Link...
CSS
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
html, body {
font-size: 14px;
}
img, video {
max-width: 100%;
}
p {
text-align: justify;
}
input[type="text"] {
width: 100%;
}
.row {
width: 500px;
max-width: 100%;
/* border: 1px solid blue; */
margin: 0 auto;
overflow: auto;
}
.row .row {
width: 100%;
margin-left: -10px;
}
.col {
padding: 0 10px;
/* border: 1px solid red; */
float:left;
}
.one {
width: 25%;
}
.two {
width: 50%;
}
.three {
width: 75%;
}
.four {
width: 100%;
}
header h1 {
margin: 0;
padding: 0;
font-size: 2em;
}
header h1 img {
vertical-align: middle;
margin-right: 5px;
}
nav ul {
list-style: none;
padding: 0;
}
nav ul li {
float: left;
/* border: 1px solid green; */
}
nav ul li a {
text-decoration: none;
color: blue;
padding: 2px;
display: inline-block;
}
.show-when-small {
display: none;
}
@media all and (max-width: 380px) {
.col {
width: 100%;
}
.row .row {
margin: auto;
}
.row .row .col {
padding: 0;
}
input {
width: 100%;
}
.main-nav {
display: none;
}
header h1 {
text-align: center;
font-size: 1em;
}
header h1 img {
display: block;
margin: 0 auto;
}
nav ul li{
width: 100%;
}
nav ul li a {
width: 100%;
}
.show-when-small {
display: block;
}
}