You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# [Mothereffing web developer tools](http://mothereff.in/)
2
+
3
+
This repository uses separate HTML and external CSS and JS files for clarity. On the live site all of this is minified and inlined together into a single HTML file per tool.
4
+
5
+
## Credits
6
+
7
+
Made by [Mathias Bynens](http://mathiasbynens.be/).
<title>Ambiguous ampersand checker for HTML</title>
5
+
<metaname=viewportcontent="width=device-width">
6
+
<linkrel=stylesheethref=eff.css>
7
+
<metaname=descriptioncontent="An on-the-fly ambiguous ampersand checker for HTML.">
8
+
<h1>Ambiguous ampersand checker for HTML</h1>
9
+
<noscript><strong>To use this tool, please <ahref=//enable-javascript.com/>enable JavaScript</a> and reload the page.</strong></noscript>
10
+
<p><textareaautofocus>foo &lolwat; bar &123; baz</textarea>
11
+
<divid=outputclass=fail><p><ahref=#foo%20%26lolwat%3B%20bar%20%26123%3B%20baz>#</a> Found 2 ambiguous ampersands:<ul><li><code>&lolwat;</code><li><code>&123;</code></ul><p>Found no character references that don’t end with a semicolon.</div>
12
+
<p>See <ahref=//mathiasbynens.be/notes/ambiguous-ampersands>“Ambiguous ampersands in HTML”</a>:
13
+
<blockquotecite=//mathiasbynens.be/notes/ambiguous-ampersands><p>To summarize: there’s a difference between unencoded ampersands (sometimes valid), ambiguous ampersands (always invalid) and encoded ampersands (always valid). An unencoded ampersand is not always an ambiguous ampersand. An unambiguous ampersand can still be invalid.</blockquote>
14
+
<p>For more information, <ahref=//mathiasbynens.be/notes/ambiguous-ampersandstitle="Ambiguous ampersands in HTML">read the whole thing</a>.
15
+
<p>Note that this tool treats all ampersands as if they were used as text, i.e. outside of an attribute value and outside of <code><script></code> or <code><style></code> elements. Browsers parse ampersands differently when they’re part of an attribute value. For example, the ampersand in <code><a href="&foo;"></code> is an ambiguous ampersand, rather than a parsed entity without a semicolon (which is what this tool would report). The ampersand in <code><script>"&foo;"</script></code> is neither.
16
+
<pid=footer>Made by <ahref=//mathiasbynens.be/>@mathias</a> — <ahref=https://github.com/mathiasbynens/mothereff.in>fork this on GitHub!</a></p>
<p>Pro tip: add <code>http://mothereff.in/byte-counter#<var>%s</var></code> to the custom search engines / location bar shortcuts in your browser of choice. Whenever I want to check string length / byte count, I just enter <code>len <var>some string</var></code> in my address bar.
13
+
<pid=footer>Made by <ahref=//mathiasbynens.be/>@mathias</a> — <ahref=https://github.com/mathiasbynens/mothereff.in>fork this on GitHub!</a></p>
Ever needed to escape a character in CSS? Ever used something like `<p class=123>` or even `<p id=/]o$o[\>` and got stuck trying to style it?
4
+
5
+
You can [learn how to do this yourself](http://mathiasbynens.be/notes/html5-id-class#css), or just let Mothereffing CSS Escapes do all the work for you. Or both. Whatever.
6
+
7
+
Made by [Mathias Bynens](http://mathiasbynens.be/).
<p>Wondering <strong>how to escape any character in CSS</strong>? <ahref=//mathiasbynens.be/notes/html5-id-class#csstitle="How to escape any character in CSS">Learn how</a>, or just use this tool ☺</p>
11
+
<noscript><strong>To use this tool, please <ahref=//enable-javascript.com/>enable JavaScript</a> and reload the page.</strong></noscript>
12
+
<h2>HTML (edit the ID and optionally hit “permalink” to save)</h2>
<pre><code><spanclass=sc2><<spanclass=element>script</span>><br><spanclass=comment>// document.getElementById or similar</span><br> document.<spanclass=method>getElementById</span><spanclass=parens>(</span><spanclass=quote>'</span><mark>1a2b3c</mark><spanclass=quote>'</span><spanclass=parens>)</span><spanclass=symbol>;</span><br><spanclass=comment>// document.querySelector or similar</span><br> $<spanclass=parens>(</span><spanclass=quote>'<mark>#\\31 a2b3c</mark>'</span><spanclass=parens>)</span><spanclass=symbol>;</span><br><<spanclass=symbol>/</span><spanclass=element>script</span>></span></code></pre>
19
+
<pid=footer>Made by <ahref=//mathiasbynens.be/>@mathias</a> — <ahref=https://github.com/mathiasbynens/mothereff.in>fork this on GitHub!</a></p>
<p>Is <codeid=acontenteditable>a << b + 3 * c</code> semantically equivalent to <codeid=bcontenteditable>a << (b + 3) * c</code>? <ahref=#a%20%3C%3C%20b%20%2B%203%20*%20c%40a%20%3C%3C%20(b%20%2B%203)%20*%20cid=permalink>#</a>
9
+
<p><strongid=output>Nope.</strong>
10
+
<pid=footer>Made by <ahref=//mathiasbynens.be/>@mathias</a> using <ahref=//zeonjs.com/>Zeon.js</a> for <ahref=//140byt.es/>@140bytes</a> — <ahref=https://github.com/mathiasbynens/mothereff.in>fork this on GitHub!</a></p>
<metaname=descriptioncontent="An on-the-fly Punycode domain name converter.">
8
+
<h1>Punycode domain name converter</h1>
9
+
<noscript><strong>To use this tool, please <ahref=//enable-javascript.com/>enable JavaScript</a> and reload the page.</strong></noscript>
10
+
<p><codeid=decodedcontenteditable>mañana.com</code> encodes to <codeid=encodedcontenteditable>xn--maana-pta.com</code>. <ahref=#ma%C3%B1ana.comid=permalink>#</a>
11
+
<pid=invalid>That’s not a valid Punycode domain name.
12
+
<pid=footer>Made by <ahref=//mathiasbynens.be/>@mathias</a> — <ahref=https://github.com/bestiejs/punycode.js>powered by Punycode.js</a> — <ahref=https://github.com/mathiasbynens/mothereff.in>fork this on GitHub!</a></p>
<title>Mothereffing unquoted attribute value validator</title>
5
+
<metaname=viewportcontent="width=device-width">
6
+
<linkrel=stylesheethref=eff.css>
7
+
<metaname=descriptioncontent="Wondering if you can use a given character sequence as an unquoted attribute value in HTML or CSS? This tool will tell you.">
8
+
<hgroup>
9
+
<h1>Mothereffing unquoted attribute value validator</h1>
10
+
<h2>“Can I use <code><a href=<var>foo</var>></a></code> and <code>a[href=<var>foo</var>] {}</code> or does it need quotes?”</h2>
11
+
</hgroup>
12
+
<noscript><strong>To use this tool, please <ahref=//enable-javascript.com/>enable JavaScript</a> and reload the page.</strong></noscript>
13
+
<label>Enter an attribute value: <inputvalue="mailto:foo@example.org?subject=bar" requiredautofocusplaceholder="e.g. http://example.com/?lol=wat"></label>
<p>To quote <ahref=//mathiasbynens.be/notes/unquoted-attribute-values>“Unquoted attribute values in HTML and CSS”</a>:
19
+
<blockquotecite=//mathiasbynens.be/notes/unquoted-attribute-values><p>A valid unquoted attribute value in HTML is any string of text that is not the empty string and that doesn’t contain spaces, tabs, line feeds, form feeds, carriage returns, <code>"</code>, <code>'</code>, <code>`</code>, <code>=</code>, <code><</code>, or <code>></code>.<p>A valid unquoted attribute value in CSS is any string of text that is not the empty string, consists of escaped characters and/or characters matching <code>/[-_\u00A0-\u10FFFF]/</code> entirely, and doesn’t start with a digit or two hyphens or a hyphen followed by a digit.</blockquote>
20
+
<pid=footer>Made by <ahref=//mathiasbynens.be/>@mathias</a> for <ahref=//paulirish.com/>π</a> — <ahref=https://github.com/mathiasbynens/mothereff.in>fork this on GitHub!</a></p>
0 commit comments