Skip to content

Instantly share code, notes, and snippets.

@bbbrrriiiaaannn
Created August 15, 2014 23:02
Show Gist options
  • Save bbbrrriiiaaannn/7cff06013d0918e222b4 to your computer and use it in GitHub Desktop.
Save bbbrrriiiaaannn/7cff06013d0918e222b4 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
div {
margin-top: 40px;
}
[data-placement-id] {
outline: 1px solid red;
}
[data-placement-id]::before {
content: "Placement: " attr(data-placement-id);
position: absolute;
margin: -26px 0 0 -1px;
height: 18px;
background: red;
color: white;
padding: 4px;
}
</style>
</head>
<body>
<div data-placement-id="sup">Hello there</div>
<script id="jsbin-source-css" type="text/css">div
margin-top: 40px
[data-placement-id]
outline: 1px solid red
&::before
content: "Placement: " attr(data-placement-id)
position: absolute
margin: -26px 0 0 -1px
height: 18px
background: red
color: white
padding: 4px</script>
</body>
</html>
div {
margin-top: 40px;
}
[data-placement-id] {
outline: 1px solid red;
}
[data-placement-id]::before {
content: "Placement: " attr(data-placement-id);
position: absolute;
margin: -26px 0 0 -1px;
height: 18px;
background: red;
color: white;
padding: 4px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment