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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


                <h1 class="heading">Live Screen Effect <span>using matrix3d()</span></h1>

<div class="laptop">

	<div class="screen-overlay">

		<iframe src="" class="live-view" sandbox="allow-scripts allow-same-origin allow-pointer-lock"></iframe>




                @import url(;

body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 0 15px;
	background-color: #0a0a0a;

.heading {
	font-family: "Montserrat", Arial, sans-serif;
	font-size: 50px;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: 2.5px;
	padding: 30px 0;
	color: #fff;
	text-align: center;
	text-shadow: 2px 2px #000;

.heading span {
	display: block;

.laptop {
	box-sizing: border-box;
	width: 900px;
	max-width: 100%;
	height: 550px;
	margin: 0 auto;
	border: 5px solid #fff;
	border-radius: 10px;
	overflow: hidden;
	background-image: url(;

.screen-overlay {
	width: 600px;
	height: 500px;
	background-color: #191919;

	/* Transform screen overlay to cover laptop screen image */
	transform: matrix3d(1.11008, 0.108202, 0, 0.000394192, 
						0.224001, 0.803852, 0, -8.80428e-05, 
						0, 0, 1, 0, 
						40, 34, 0, 1);
	transform-origin: 0 0 0;

.live-view {
	width: 200%;
	height: 200%;
	transform: scale(0.5);
	transform-origin: top left;

	/* Prevent user interaction with iframe content */
	/* pointer-events: none; */




Full-page view: