Skip to content

Instantly share code, notes, and snippets.

@ddrscott
Created May 21, 2014 18:23
Show Gist options
  • Save ddrscott/a7e53dd2a58f20daa1e7 to your computer and use it in GitHub Desktop.
Save ddrscott/a7e53dd2a58f20daa1e7 to your computer and use it in GitHub Desktop.
Color background of all elements on a page via bookmarklet
// @see http://www.quora.com/Web-Development/What-are-the-most-interesting-HTML-JS-DOM-CSS-hacks-that-most-web-developers-dont-know-about
// @see http://qr.ae/Khvbr
var s=document.createElement('style');
s.textContent = "<style> * { background-color: rgba(255,0,0,.2) !important} * * { background-color: rgba(0,255,0,.2) !important} * * * { background-color: rgba(0,0,255,.2) !important} * * * * { background-color: rgba(255,0,255,.2) !important} * * * * * { background-color: rgba(0,255,255,.2) !important} * * * * * * { background-color: rgba(255,255,0,.2) !important}</style>";
document.getElementsByTagName('head')[0].appendChild(s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment