Skip to content

Instantly share code, notes, and snippets.

@tannerhodges
Forked from anonymous/index.html
Last active August 29, 2015 14:26
Show Gist options
  • Save tannerhodges/c3a83f612115e66e6cd3 to your computer and use it in GitHub Desktop.
Save tannerhodges/c3a83f612115e66e6cd3 to your computer and use it in GitHub Desktop.
CSS Diagonal Strikethrough // source http://jsbin.com/oqibus/1
<!-- Found at http://stackoverflow.com/a/14593540/1786459 -->
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<style id="jsbin-css">
.strikethrough {
position: relative;
}
.strikethrough:before {
position: absolute;
content: "";
left: 0;
top: 50%;
right: 0;
border-top: 1px solid;
border-color: inherit;
-webkit-transform:rotate(-5deg);
-moz-transform:rotate(-5deg);
-ms-transform:rotate(-5deg);
-o-transform:rotate(-5deg);
transform:rotate(-5deg);
}
</style>
</head>
<body>
<span class="strikethrough">Deleted text</span>
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<span class="strikethrough">Deleted text</span>
</body>
</html>
</script>
<script id="jsbin-source-css" type="text/css">.strikethrough {
position: relative;
}
.strikethrough:before {
position: absolute;
content: "";
left: 0;
top: 50%;
right: 0;
border-top: 1px solid;
border-color: inherit;
-webkit-transform:rotate(-5deg);
-moz-transform:rotate(-5deg);
-ms-transform:rotate(-5deg);
-o-transform:rotate(-5deg);
transform:rotate(-5deg);
}</script>
</body>
</html>
.strikethrough {
position: relative;
}
.strikethrough:before {
position: absolute;
content: "";
left: 0;
top: 50%;
right: 0;
border-top: 1px solid;
border-color: inherit;
-webkit-transform:rotate(-5deg);
-moz-transform:rotate(-5deg);
-ms-transform:rotate(-5deg);
-o-transform:rotate(-5deg);
transform:rotate(-5deg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment