• HOME > prettify.html

簡単にコードを色分け  onclickでも良い

行番号あり:prettyprint lang-html linenums

<html lang="jp">
<head>
<link href="prettify.css" rel="stylesheet">
<script src="prettify.js"></script>
<style type="text/css" media="all">
pre.prettyprint {
  width: 95%;
  margin: 1em auto;
  padding: 1em;
  white-space: pre-wrap;
}
</style>
<script type="text/javascript">
function langHandlerForExtension(extension, source) {if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {extension = /^\s*</.test(source)? 'default-markup': 'default-code';}return langHandlerRegistry[extension];}registerLangHandler(decorateSource, ['default-code']);registerLangHandler(createSimpleLexer([],[[PR_PLAIN,       /^[^<?]+/],[PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],[PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],['lang-',        /^<%([\s\S]+?)(?:%>|$)/],[PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]]),['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);registerLangHandler(createSimpleLexer([[PR_PLAIN,        /^[\s]+/,…
</script>
</head>
<body>
<pre  class="prettyprint lang-html linenums" onmouseover="prettyPrint();adjustHeightInParent()">
<a  href="http://jquery.com">jquery.com<a>
</pre>
</body>

行番号なし:prettyprint lang-html

<html lang="jp">
<head>
<link href="prettify.css" rel="stylesheet">
<script src="prettify.js"></script>
<style type="text/css" media="all">
pre.prettyprint {
  width: 95%;
  margin: 1em auto;
  padding: 1em;
  white-space: pre-wrap;
}
</style>
<script type="text/javascript">
function langHandlerForExtension(extension, source) {if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {extension = /^\s*</.test(source)? 'default-markup': 'default-code';}return langHandlerRegistry[extension];}registerLangHandler(decorateSource, ['default-code']);registerLangHandler(createSimpleLexer([],[[PR_PLAIN,       /^[^<?]+/],[PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],[PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],['lang-',        /^<%([\s\S]+?)(?:%>|$)/],[PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]]),['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);registerLangHandler(createSimpleLexer([[PR_PLAIN,        /^[\s]+/,…
</script>
</head>
<body>
<pre  class="prettyprint lang-html" onmouseover="prettyPrint();adjustHeightInParent()">
<a  href="http://jquery.com">jquery.com<a>
</pre>
</body>
Δ

Html Checker