Skip to content

Instantly share code, notes, and snippets.

@robbestad
Created June 30, 2013 20:13
Show Gist options
  • Save robbestad/5896678 to your computer and use it in GitHub Desktop.
Save robbestad/5896678 to your computer and use it in GitHub Desktop.
CSS - border without markup
/*------------------------------------*\
BORDERS
\*------------------------------------*/
/* Create a series of empty pseudo-elements... */
html:before,html:after,body:before,body:after{
content:"";
background:#dad8bb;
position:fixed;
display:block;
z-index:5;
}
/* ...and position them! */
html:before{
height:1px;
left:0;
right:0;
top:0;
}
html:after{
width:1px;
top:0;
right:0;
bottom:0;
}
body:before{
height:1px;
right:0;
bottom:0;
left:0;
}
body:after{
width:1px;
top:0;
bottom:0;
left:0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment