Skip to content

Instantly share code, notes, and snippets.

@gabrielso
Created September 18, 2012 19:30
Show Gist options
  • Save gabrielso/3745276 to your computer and use it in GitHub Desktop.
Save gabrielso/3745276 to your computer and use it in GitHub Desktop.
Box in brackets border
* { /* optional, must subtract .border width by his own border-width if absent */
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.border {
background: transparent;
border-right: 80px solid black;
border-left: 80px solid black;
position: relative;
width: 502px;
}
.content {
background: rgb(204,204,255);
left: -79px; /* .border border-width -1px */
position: absolute;
top: 1px;
width: 500px;
}
<!doctype html>
<html lang="en">
<head>
<title>Box-in-brackets</title>
<meta charset="utf-8">
<meta name="author" content="Gabriel Oliveira (@gabaiel)">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="index.css" media="screen">
</head>
<body>
<section class="border">
<section class="content">
<!-- Your content here -->
</section>
</section>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment