Created
August 14, 2014 00:11
-
-
Save jayrgee/da448883ca358f18ed8f to your computer and use it in GitHub Desktop.
// source http://jsbin.com/yeciri/1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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