Pen Settings

HTML

CSS

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

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                .content
	p The most merciful thing in the world, I think, is the inability of the human mind to correlate all its contents. We live on a placid island of ignorance in the midst of black seas of infinity, and it was not meant that we should voyage far. The sciences, each straining in its own direction, have hitherto harmed us little; but some day the piecing together of dissociated knowledge will open up such terrifying vistas of reality, and of our frightful position therein, that we shall either go mad from the revelation or flee from the light into the peace and safety of a new dark age.
	p Theosophists have guessed at the awesome grandeur of the cosmic cycle wherein our world and human race form transient incidents. They have hinted at strange survivals in terms which would freeze the blood if not masked by a bland optimism. But it is not from them that there came the single glimpse of forbidden eons which chills me when I think of it and maddens me when I dream of it. That glimpse, like all dread glimpses of truth, flashed out from an accidental piecing together of separated things - in this case an old newspaper item and the notes of a dead professor. I hope that no one else will accomplish this piecing out; certainly, if I live, I shall never knowingly supply a link in so hideous a chain. I think that the professor, too intented to keep silent regarding the part he knew, and that he would have destroyed his notes had not sudden death seized him.
	p My knowledge of the thing began in the winter of 1926 with the death of my greatuncle, George Gammell Angell, Professor Emeritus of Semitic Languages in Brown University, Providence, Rhode Island. Professor Angell was widely known as an authority on ancient inscriptions, and had frequently been resorted to by the heads of prominent museums; so that his passing at the age of ninety-two may be recalled by many. Locally, interest was intensified by the obscurity of the cause of death. The professor had been stricken whilst returning from the Newport boat; falling suddenly; as witnesses said, after having been jostled by a nautical looking negro who had come from one of the queer dark courts on the precipitous hillside which formed a short cut from the waterfront to the deceased's home in Williams Street. Physicians were unable to find any visible disorder, but concluded after perplexed debate that some obscure lesion of the heart, induced by the brisk ascent of so steep a hill by so elderly a man, was responsible for the end. At the time I saw no reason to dissent from this dictum, but latterly I am inclined to wonder - and more than wonder.
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=PT+Serif)
$line-start: paleturquoise
$line-end: pink
$line-weight: 4px
body
	background: #E8E5ED
.content
	font-family: 'PT Serif', Times New Roman, serif
	font-size: 23px
	line-height: 1.8
	color: #000
	max-width: 600px
	margin: 0 auto
	text-align: justify
	span
		display: inline-block
		word-break: keep-all
		margin: 0 0.3em
	.line
		display: flex
		justify-content: space-between
		position: relative
		&:before, &:after
			content: ''
			display: block
			position: absolute
			top: 50%
		&:before
			height: $line-weight
			width: 100%
			margin-left: -0.4em
			padding: 0 0.4em
			background: linear-gradient(left, $line-start, $line-end)
			z-index: -1
		&:after
			box-sizing: border-box
			width: $line-weight
			height: 1.8em
			height: calc(1.8em + #{$line-weight})
			background: linear-gradient(bottom, $line-start, $line-end)
			border-radius: 0 $line-weight $line-weight 0
			right: -0.4em
			right: calc(-0.4em - #{$line-weight})
		&:nth-child(2n)
			transform: rotateY(180deg)
		&:last-child
			display: block
			&:after
				display: none
			&:nth-child(2n+1)
				display: inline-block
              
            
!

JS

              
                $('.content p').each(function() {
	var $this = $(this);
	var words = $this.text().split(' ');
	var html = '';
	for (i = 0; i < words.length; i++) {
		html += '<span>'+words[i]+'</span>';
	}
	$this.html(html);
	var $words = $this.children('span');
	var toppos = $words.first().position().top;
	var topindex = 0;
	$words.each(function(i) {
		var $word = $(this);
		var curpos = $word.position().top;
		if (toppos != curpos) {
			toppos = curpos;
			$words.slice(topindex, i).wrapAll("<div class='line'></div>");
			topindex = i;
		}
	});
	$words.slice(topindex).wrapAll("<div class='line'></div>");
});
              
            
!
999px

Console