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

              
                <div class="viewport"><span id="w"></span><span id="h"></span></div>
<!-- 
You will need to add the following for the demo: id="characters"
Do not delete or edit anything above this line.
Make your edits below this line -->

<div class="row">
	<div class="col-8">
		<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1932025/LHCL-PRIM-WSTUFF-web-rez.jpg">
	</div>
	<div class="col-4">
			<div class="col-12">
				<p id="characters">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>
			</div>
			<div class="col-6">
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1932025/LHCL-PRIM-FRONT.jpg">
			</div>
			<div class="col-6">
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1932025/LHCL-PRIM-SIDE.jpg">
			</div>
	</div>
</div>

<div class="row">
	<div class="col-8">
		<h2>Lorem ipsum dolor sit amet</h2>
		<p>consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>
	</div>
</div>
<div class="row">
	<div class="col-2">
		<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1932025/LHACC-TR.jpg">
	</div>
	<div class="col-2">
		<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1932025/LHACC-KIT.jpg">
	</div>
	<div class="col-2">
		<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1932025/LHACC-PET.jpg">
	</div>
	<div class="col-2">
		<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1932025/LHACC-BED.jpg">
	</div>
</div>

<div class="row">
	<div class="col-12">
		<h1>Introduction to web typography</h1>
		<p><i>Web typography</i> refers to the use of fonts on the <em>World Wide Web</em>. When HTML was first created, font faces and styles were controlled exclusively by the settings of each Web browser. There was no mechanism for individual Web pages to control font display until Netscape introduced the <code>&lt;font&gt;</code> tag in 1995, which was then standardized in the HTML 2 specification. However, the font specified by the tag had to be installed on the user's computer or a fallback font, such as a browser's default sans-serif or monospace font, would be used. The first <b>Cascading Style Sheets</b> specification was published in 1996 and provided the same capabilities.</p>
	</div>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Exo+2:300,300i,600|Vollkorn:700');

body {
	font-family: 'Exo 2', sans-serif;
	font-weight: 300;
}

i, em {
	font-style: italic;
}

b, strong {
	font-weight: 600;
}

h1, h2, h3 {
	font-family: 'Vollkorn', serif;
	font-weight: 700;
}

/* STOP!!!!!!! DO NOT DELETE OR CHANGE ANYTHING BELOW THIS LINE!!!!!!! */
.row {
	margin: 14px auto;
	width: 100%;
}

.row:after {
    clear: both;
    content: "";
    display: table;
}

[class^="col-"] {
	float: left;
	width: 100%;
}

[class^="col-"] {
	margin-left: 10px;
	margin-right: 10px;
}

.col-1 {
	width: calc(8.33333333% - 20px);   
}

.col-2 {
	width: calc(16.66666666% - 20px);   
}

.col-3 {
	width: calc(25% - 20px);   
}

.col-4 {
	width: calc(33.33333333% - 20px);   
}

.col-5 {
	width: calc(41.66666666% - 20px);   
}

.col-6 {
	width: calc(50% - 20px);
}

.col-7 {
	width: calc(58.33333333% - 20px);   
}

.col-8 {
	width: calc(66.66666666% - 20px);   
}

.col-9 {
	width: calc(75% - 20px);   
}

.col-10 {
	width: calc(83.33333333% - 20px);   
}

.col-11 {
	width: calc(91.66666666% - 20px);   
}

.col-12 {
	width: calc(100% - 20px);   
}

img {
	max-width: 100%;
}

.viewport {
	background-color: rgba(255, 0, 0, 0.5);
	border-bottom-left-radius: 8px;
	color: #fff;
	font-family: 'Courier New', Courier, monospace;
	font-size: 2em;
	right: 0;
	text-align: center;
	top: 0;
	padding: 3px 5px 0 5px;
	position: fixed;
}

.highlight {
	background-color: rgba(255, 255, 0, 0.75);
}
              
            
!

JS

              
                (function() {
	var ele = document.getElementById("characters");
	if (ele) {
		var str= document.getElementById("characters").innerHTML;
		var str1 = "";
		for(var i = 45; i < 75; i++) {
			str1 += str[i];
		}
		var n=str.replace(str1,'<span class="highlight">' + str1 + '</span>');
		document.getElementById("characters").innerHTML=n;
	}

	if (typeof(document.documentElement.clientWidth) != 'undefined') {
		var $w = document.getElementById('w'),
			$h = document.getElementById('h');
		$w.innerHTML = document.documentElement.clientWidth;
		$h.innerHTML = ' &times; ' + document.documentElement.clientHeight;
		window.onresize = function(event) {
			$w.innerHTML = document.documentElement.clientWidth;
			$h.innerHTML = ' &times; ' + document.documentElement.clientHeight;
		};
	}
})();
              
            
!
999px

Console