Skip to content

Instantly share code, notes, and snippets.

@jayrgee
Created August 14, 2014 00:11
Show Gist options
  • Save jayrgee/da448883ca358f18ed8f to your computer and use it in GitHub Desktop.
Save jayrgee/da448883ca358f18ed8f 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">
svg {
background: #4169E1 url('data:image/svg+xml;,<svg xmlns="http://www.w3.org/2000/svg" fill="%23fff"><pattern id="a" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M10 0v9h9v1h-9v9h-1v-9h-9v-1h9v-9" opacity=".15"/><path d="M0 19h19v-19h1v20h-20" opacity=".25"/></pattern><rect width="100%" height="100%" fill="%234169E1"/><rect width="100%" height="100%" fill="url(%23a)"/></svg>');
}
</style>
</head>
<body>
<script id="jsbin-javascript">
var xmlns = "http://www.w3.org/2000/svg",
s = document.createElementNS(xmlns, "svg");
s.setAttributeNS(null,'width',350);
s.setAttributeNS(null,'height',350);
document.body.appendChild(s);
</script>
</body>
</html>
svg {
background: #4169E1 url('data:image/svg+xml;,<svg xmlns="http://www.w3.org/2000/svg" fill="%23fff"><pattern id="a" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M10 0v9h9v1h-9v9h-1v-9h-9v-1h9v-9" opacity=".15"/><path d="M0 19h19v-19h1v20h-20" opacity=".25"/></pattern><rect width="100%" height="100%" fill="%234169E1"/><rect width="100%" height="100%" fill="url(%23a)"/></svg>');
}
var xmlns = "http://www.w3.org/2000/svg",
s = document.createElementNS(xmlns, "svg");
s.setAttributeNS(null,'width',350);
s.setAttributeNS(null,'height',350);
document.body.appendChild(s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment