Skip to content

Instantly share code, notes, and snippets.

@absent1706
Created August 19, 2016 19:18
Show Gist options
  • Save absent1706/d4244771510f0b6b2c5c3f312857c32e to your computer and use it in GitHub Desktop.
Save absent1706/d4244771510f0b6b2c5c3f312857c32e to your computer and use it in GitHub Desktop.
css-simple-bootstrap
/* Grid system */
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.container:after, .container:before, .row:after, .row:before {
content: " "; display: table;
}
.container:after, .container:before, .row:after {clear:both; }
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6 {
float:left;
padding-left: 15px;
padding-right: 15px;
border: 1px solid;
}
.col-sm-1 {width: 16.7%;}
.col-sm-2 {width: 33%;}
.col-sm-3 {width: 49.7%;}
.col-sm-4 {width: 66%;}
.col-sm-5 {width: 82.7%;}
.col-sm-6 {width: 100%;}
.container {
margin-right: auto;
margin-left: auto;
}
@media (max-width: 767px) {
.container {
width: 100%;
}
.col-lg-1 {width: 100%}
.col-lg-2 {width: 100%}
.col-lg-3 {width: 100%}
.col-lg-4 {width: 100%}
.col-lg-5 {width: 100%}
.col-lg-6 {width: 100%}
}
@media (min-width: 768px) {
.container {
width: 750px;
}
.col-lg-1 {width: 16.7%;}
.col-lg-2 {width: 33%;}
.col-lg-3 {width: 49.7%;}
.col-lg-4 {width: 66%;}
.col-lg-5 {width: 82.7%;}
.col-lg-6 {width: 100%;}
}
/* Responsive images */
.img-responsive {
display: block;
max-width: 100%;
height: auto;
}
/* General classes */
.pull-left {
float: left;
}
.pull-right {
float: right;
}
.padding-10 {
padding: 10px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=2.0">
<title>Simple grid</title>
<link rel="stylesheet" href="framework.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-lg-2">
<img src="http://say-hi.me/blog/wp-content/uploads/2014/05/Sayhi_Logo31.png" class="img-responsive" alt="">
</div>
<div class="col-lg-4">
<a href="">home</a>
<div class="pull-right">
<a href="">login</a>
<a href="">logout</a>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<ul>
<li>
<a href="#">item1</a>
</li>
<li>
<a href="#">item2</a>
</li>
<li>
<a href="#">item3</a>
</li>
<li>
<a href="#">item4</a>
</li>
</ul>
</div>
<div class="col-lg-4">
<h2>Site content</h2>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis consequatur at molestiae, eius deserunt, porro pariatur aliquid accusamus, voluptatem adipisci quae molestias debitis sit dolorem excepturi, reiciendis laborum maiores. Eos provident ducimus laudantium omnis? Quaerat aperiam molestiae quo maiores minima, quisquam eos voluptas incidunt. Tenetur soluta incidunt labore accusantium ipsa enim vero dicta reiciendis nam, sunt id, vitae neque recusandae rem totam fuga in perspiciatis architecto magnam et provident repellat suscipit? Quod minus, laudantium illum excepturi magni obcaecati cumque. Corrupti aliquam, nisi qui quod eligendi at, incidunt in aut voluptas natus ullam eum iste neque adipisci laudantium esse, modi! Quibusdam.
</div>
</div>
<!-- Footer -->
<div class="row">
</div>
<div class="row">
<div class="col-lg-1">
<img src="http://say-hi.me/blog/wp-content/uploads/2014/05/Sayhi_Logo31.png" class="img-responsive" alt="">
</div>
<div class="col-lg-5">
<div class="pull-left padding-10">
<p><a href="">link1</a></p>
<p><a href="">link2</a></p>
</div>
<div class="pull-left padding-10">
<p><a href="">link3</a></p>
<p><a href="">link4</a></p>
</div>
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment