Skip to content

Instantly share code, notes, and snippets.

@joa
Created April 3, 2012 16:19
Show Gist options
  • Save joa/2293314 to your computer and use it in GitHub Desktop.
Save joa/2293314 to your computer and use it in GitHub Desktop.
Having fun with HTML whitespace behaviour
<!DOCTYPE html>
<html>
<head>
<style>
b { font-weight: normal; background-color: #f0f; }
i { font-style: normal; background-color: #ff0; }
pre { background-color: #0ff; }
.arrg { white-space: pre; background-color: #f00; }
body { background: #333; }
</style>
</head>
<body>
<b>foo</b> <i>bar</i><br/>
<b>foo </b> <i>bar</i><br/>
<b>foo</b> <i> bar</i><br/>
<b>foo </b> <i> bar</i><br/>
<p> <b> foo </b> </p>
<p> <i> bar </i> </p>
<pre> foo </pre>
<span class="arrg"> hello </span>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment