Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.



<h2>Nur die nackten Fakten:</h2>
<button id="openBtn">Mehr erfahren</button>
<dialog id="dialog">
	<button id="closeBtn">close</button>
			<h4>WHERE IN THE WORLD</h4>
			<p>Mount Greylock, Massachusetts, North America</p>
			<p>School of witchcraft and wizardry</p>
			<p>Founded by Isolt Sayre, James Steward, Chadwick Boot and Webster Boot
			<p>Enchanted carvings of the four house beasts that react in the presence of new students</p>



                /* Only for styling, not required for it to work */
body {
	background-color: blanchedalmond;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;

h1 {
	font-size: 3rem;
	color: indianred;
	font-family: "Berkshire Swash", cursive;
	text-align: center;

h2 {
		font-size: 1.4rem;
	color: #333;
	font-family: "Berkshire Swash", cursive;
	text-align: center;

#openBtn, #closeBtn {
	border: none;
	background-color: hsl(0, 0%, 20%);
	color: #fff;
	border-radius: 3px;
	width: 200px;
	height: 40px;
	font-size: 1rem;
	font-family: sans-serif;
	cursor: pointer;

#closeBtn {
	width: 80px;
	height: 30px;
	font-size: 0.9rem;
	margin-bottom: 30px;

#openBtn:hover, #openBtn:focus,
#closeBtn:hover, #closeBtn:focus{
	background-color: hsl(0, 56%, 30%);

dialog {
	width: 80%;
	height: 80%;
	position: absolute;
	top: 30px;
	font-family: sans-serif;
	color: #555;

ul {
	list-style-type: none;
li {
	margin-bottom: 40px;

h4, p {
	margin: 0;

p {
	margin-top: 12px;


                const dialog = document.getElementById('dialog');
const openBtn = document.getElementById('openBtn');
const closeBtn = document.getElementById('closeBtn');

openBtn.addEventListener('click', function() {
	dialog.setAttribute('open', true);

closeBtn.addEventListener('click', function() {