css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <section class="container">
				  <h1>White-space pre</h1>
			<div class="pre mouse-tale">
&ldquo;Fury said to 
		a mouse, That 
			he met in the 
			house, &lsquo;Let 
				us both go 
					to law: I 
					will prosecute you. 
						&ndash;Come, I'll take 
							no denial; 
						We must have 
					a trial: 
				For really 
			this morning 
		I've nothing to do.&rsquo;
	Said the mouse 
to the cur, 
	&lsquo;Such a trial, 
			dear Sir, 
				With no jury 
					or judge, 
						would be wasting 
							our breath.&rsquo; 
						&lsquo;I'll be judge, 
					I'll be jury,&rsquo; 
				said cunning old Fury: 
			&lsquo;I'll try the whole cause, 
		and condemn you 
	to death.&rsquo; &rdquo;
			</div>
  
<div class="pre">
  <h2>pre Without tab-size</h2>
.elem1 {
	  color: blue;	
}
		
.elem2 {
  	color: red;	
}
			</div>
			
			<div class="pre tab-size">
        <h2>tab-size With pre</h2>
.elem1 {
   color: blue;	
}
		
.elem2 {
  	color: red;	
}
			</div>
</section>

<section class="container">
				<h1>White-space pre-wrap</h1>	
			<div class="pre-wrap">
&lsquo;How doth the little crocodile
Improve his shining tail,
And pour the waters of the Nile
On every golden scale!

&lsquo;How cheerfully he seems to grin,
How neatly spread his claws,
And welcome little fishes in
With gently smiling jaws!&rsquo;
			</div>
		</section>

<section class="container">
				<h1>White-space pre-line</h1>
			<div class="pre-line">
				&ldquo;Fury said to
					a mouse, That 
						he met in the
							house, &lsquo;Let
								us both go 
									to Law ...&rdquo; 
			</div>
		</section>

<p class="p">Demo by Antonietta Perna. <a href="http://www.sitepoint.com/css-properties-to-control-web-typography/" target="_blank">See article</a>.</p>

            
          
!
            
              * {
  box-sizing: border-box;
}

body {
  background-color: #eee;
  font-family: Verdana, Arial, sans-serif;
  font-size: 100%;
  font-weight: lighter;
  line-height: 1.5;
  color: #444;
}

h1 {
  font-size: 1.8em;
  line-height: 1;
  font-weight: lighter;
  font-family: Georgia, "Times New Roman", serif;
}

.container {
  max-width: 100%;
  min-width: 300px;
  margin: 0 auto;
  background-color: #fff;
  padding: 1em 2em;
}

@media screen and (min-width: 768px) {
  .container {
    max-width: 60%;
  }
}

.container h1,
.container h2 {
  text-align: center;
}

.pre {
  white-space: pre;
  font-family: monospace;
}

.pre h2 {
  white-space: normal;
  font-family: Georgia, serif;
  font-size: 2em;
}

.mouse-tale {
  font-family: Verdana, sans-serif;
  font-size: .8em;
}

.tab-size {
  tab-size: 4;
  -moz-tab-size: 4;
  -o-tab-size: 4;
}

.pre-wrap {
  white-space: pre-wrap;
  width: 100%;
  min-width: 200px;
  outline: 1px solid #eee;
  margin: 0 auto 2em;
}

.pre-wrap > div {
  width: 100%;
}

.pre-line {
  white-space: pre-line;
}

.p {
  text-align: center;
  font-size: 13px;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console