Skip to content

Instantly share code, notes, and snippets.

@marek-saji
Created February 28, 2012 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marek-saji/1932681 to your computer and use it in GitHub Desktop.
Save marek-saji/1932681 to your computer and use it in GitHub Desktop.
How to make <pre> grow with <code>?
/**
* How to make <pre> grow with <code>?
*/
html
{
background-color: #111;
}
article
{
outline : orange solid thick;
width : 20em;
}
pre
{
background-color : #43424F;
color : white;
text-shadow : rgba(255, 255, 255, .8) 0 0 0.2em;
white-space : normal;
}
pre code
{
display : block;
white-space : pre;
}
<article>
<pre><code>#include "stdio.h"</code>
<code></code>
<code>int main (int argv, char **argv) {</code>
<code> printf("Hello world program is a computer program that outputs 'Hello, world' on a display device. Because it is typically one of the simplest programs possible in most programming languages, it is by tradition often used to illustrate to beginners the most basic syntax of a programming language, or to verify that a language or system is operating correctly.\n");</code>
<code> return 0;</code>
<code>}</code>
</article>
{"view":"split-vertical","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment