Created
December 13, 2010 07:59
-
-
Save nissuk/738774 to your computer and use it in GitHub Desktop.
HTMLの構造を可視化する(Chrome用)
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
javascript:(function(){ | |
var sheet = []; | |
[].forEach.call(document.querySelectorAll('[id]'), function(i){ | |
var selector = i.tagName + '#' + i.id; | |
sheet.push( | |
selector + ' { outline: 1px solid #f66 }', | |
selector + '::before { ' | |
+ 'content: "' + selector + '";' | |
+ 'position: absolute; z-index: 100;' | |
+ 'margin: 1px; padding: 4px; border: 1px solid white; border-radius: 4px;' | |
+ 'color: #666; background: greenyellow; font: 11px/1.2 arial;' | |
+ '}', | |
selector + ':target { background: #ffc }', | |
selector + ':target::before, ' + selector + ':hover::before ' | |
+ '{ z-index: 200; background-color: yellow }' | |
); | |
}); | |
var style = document.createElement('style'); | |
style.textContent = sheet.join('\n'); | |
document.head.appendChild(style); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment