Skip to content

Instantly share code, notes, and snippets.

View aekaplan's full-sized avatar

Adam Kaplan aekaplan

View GitHub Profile
@aekaplan
aekaplan / gist:5679831
Last active December 17, 2015 22:09
Pseudo-Classes 1 CSS
p.example:before {
background: #d31742;
content: "before";
color: #fff;
padding: 0 0.3em;
}
p.example:after {
background: #d31742;
content: "after";
@aekaplan
aekaplan / gist:5682773
Last active December 17, 2015 22:29
Pseudo-Classes 7 CSS
.column-example {
float: left;
margin-left: 3.2%;
width: 31.2%;
}
.column-example:first-child {
border: 1px solid #008080;
margin-left: 0;
}
@aekaplan
aekaplan / gist:5682833
Last active December 17, 2015 22:29
Pseudo-Classes 5 HTML
<div class="row">
<div class="column-example-bad first">
<p>Column 1</p>
</div>
<div class="column-example-bad">
<p>Column 2</p>
</div>
<div class="column-example-bad">
@aekaplan
aekaplan / gist:5682842
Last active December 17, 2015 22:29
Pseudo-Classes 6 CSS
.column-example-bad {
float: left;
margin-left: 3.2%;
width: 31.2%;
}
.first {
border: 1px solid #008080;
margin-left: 0
}
@aekaplan
aekaplan / gist:5682861
Last active December 17, 2015 22:29
Pseudo-Classes 8 HTML
<div class="row">
<div class="column-example">
<p>Column 1</p>
</div>
<div class="column-example">
<p>Column 2</p>
</div>
<div class="column-example">
@aekaplan
aekaplan / gist:8243831
Last active January 2, 2016 03:29
Viewport Meta Tag (HTML)
<meta name="viewport" content="width=device-width, initial-scale=1">
@aekaplan
aekaplan / gist:8246124
Last active January 2, 2016 03:49
Create a Container - CSS
.container {
margin: 0 auto;
max-width: 48rem;
width: 90%;
}
@aekaplan
aekaplan / gist:8246032
Last active January 2, 2016 03:49
Create a Container - HTML
<div class="container">
<!-- Your Content -->
</div>
@aekaplan
aekaplan / gist:8247563
Last active January 2, 2016 03:59
Box-sizing:border-box - CSS
*, *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
@aekaplan
aekaplan / gist:8430571
Last active January 3, 2016 07:39
Create Rows - HTML
<div class="container">
<div class="row clearfix">
<div class="column half">
<!-- Your Content -->
</div>
<div class="column half">
<!-- Your Content -->
</div>
</div>