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 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

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

              
                <body>
	<section>
		<div class="modal_open button ">
			CLICK HERE
		</div>
	</section>
	
	
	<div class="modal">
		<div class="modal_close main">
			<i class="fas fa-times"></i>
		</div>
		
		<div class="copy">
			<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris varius iaculis mauris, in lacinia purus congue porta. Nulla a semper mi, ac vehicula elit. Donec lacinia justo vitae libero viverra aliquet. Nam vitae semper ligula. Praesent volutpat purus et lectus elementum molestie. Vivamus fringilla ex et dui porttitor viverra. Suspendisse metus mauris, maximus id velit et, mollis cursus orci. Vestibulum ultrices, nibh malesuada hendrerit suscipit, purus urna vulputate nisi, sit amet faucibus elit augue in urna. Sed sagittis luctus rutrum. Morbi placerat molestie diam, ut mollis lacus hendrerit et. Duis auctor gravida eleifend. Suspendisse convallis condimentum purus.</p>
			
			<a class="button">CTA</a>
		</div>
	</div>
	<div class="modal_overlay"></div>
</body>
              
            
!

CSS

              
                
.button
	border solid 3px #000 
	display inline-block
	padding 5px 15px
	cursor pointer
	transition .25s ease-in-out
	&:hover
		background-color #999
		color #fff
		transform translate3d(-5px,-5px,0)
		box-shadow 5px 5px rgba(0,0,0,.75)

.modal_overlay
	position fixed
	top 0
	left 0
	width 100%
	height 100%
	z-index 1000
	background-color rgba(0,0,0,.5)
	opacity 0
	pointer-events none
	transition .5s ease-in-out
	will-change opacity
	&.active
		opacity 1
		pointer-events auto

.modal
	position fixed
	top 20%
	left 50%
	transform translate3d(-50%,50px,0)
	z-index 1001
	background-color #ccc;
	padding 35px
	width 100%
	max-width 500px
	opacity 0
	pointer-events none
	transition .5s ease-in-out
	transition-delay .0s
	will-change transform, opacity
	&.active
		opacity 1
		pointer-events auto
		transform translate3d(-50%,0px,0)
		transition-delay .25s
	>.modal_close.main
		position absolute
		height 50px
		width 50px
		display flex
		justify-content center
		align-items center
		top -25px
		right -25px
		font-size 20px
		border-radius 100%
		box-sizing border-box
		background-color #fff
		color #000
		border solid 3px #fff
		cursor pointer
		transition .25s ease-in-out
		&:hover
			border solid 3px #000
		
section
	display flex
	justify-content center
	align-items center
	height 300px
              
            
!

JS

              
                $(document).ready(function(){
//MODALS
	//OPEN
		$('body').on('click','.modal_open',function(e) {
			e.preventDefault();
			$('.modal_overlay').addClass('active');
			$('.modal').addClass('active');
		});
	//CLOSE
		$('body').on('click','.modal_overlay',function(e) {
			e.preventDefault();
			$('.modal_overlay').removeClass('active');
			$('.modal').removeClass('active');
		});
		$('body').on('click','.modal_close',function(e) {
			e.preventDefault();
			$('.modal_overlay').removeClass('active');
			$('.modal').removeClass('active');
		});
	
});
              
            
!
999px

Console