Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created February 23, 2013 17:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save shigemk2/5020482 to your computer and use it in GitHub Desktop.
疑似要素をz-indexしてれぅ
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>HOGE</title>
<style type="text/css">
body {
background-color: rgba(255,0,0,.5);
}
div.hoge {
position: absolute;
top: 200px;
left: 300px;
display: block;
width: 200px;
height: 100px;
background-color: rgba(255,255,255,1);
}
div.hoge:before {
content: '▼';
position: relative;
top: -5px;
left: -8px;
z-index: -1;
}
div.hoge:after {
content: '▼';
position: relative;
top: -29px;
left: 192px;
z-index: -1;
}
</style>
</head>
<body>
<div class="hoge">HOGEHOGE</div>
<div class="hoge">HOGEHOGE</div>
<div class="hoge">HOGEHOGE</div>
<div class="hoge">HOGEHOGE</div>
<div class="hoge">HOGEHOGE</div>
<div class="hoge">HOGEHOGE</div>
<div class="hoge">HOGEHOGE</div>
<div class="hoge">HOGEHOGE</div>
<div class="hoge">HOGEHOGE</div>
<div class="hoge">HOGEHOGE</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment