Skip to content

Instantly share code, notes, and snippets.

@dziudek
Created March 21, 2012 10:22
Show Gist options
  • Save dziudek/2146020 to your computer and use it in GitHub Desktop.
Save dziudek/2146020 to your computer and use it in GitHub Desktop.
Layout with the two lines at both sides without using additional elements (only :after and :before)
/**
* Layout with the two lines at both sides without using additional elements (only :after and :before)
*/
div {
background: #fff;
width:100%;
height:30px;
text-align: center;
position: relative;
}
div:before,
div:after {
background:#0a0;
content: "";
height:30px;
width:30%;
right:0;
position: absolute;
z-index: 1;
}
div:before{
left:0;
right:auto;
}
div > ul {
display:inline-block;
position: relative;
z-index:2;
}
div > ul li {
float:left;
}
<!-- content to be placed inside <body>…</body> -->
<div>
<ul>
<li>Lorem ipsum dolor sit amet dolor loles x</li>
<li>Lorem ipsum dolor sit amet dolor loles x</li>
<li>Lorem ipsum dolor sit amet dolores loles x</li>
</ul>
</div>
{"view":"split","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment