Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <!DOCTYPE html>
<html>
<head>
	<title>Accordion</title>
	<link rel="preconnect" href="https://fonts.gstatic.com">
	<link href="https://fonts.googleapis.com/css2?family=Syne+Mono&display=swap" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="style.css">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body class="body" id="body__wrapper">
	<div class="page__wrapper">
		<h1 class="heading">Power of HTML</h1>
		<div class="accordion">
			<details>
			  <summary>What are some random questions to ask?</summary>
			  <p>That's exactly the reason we created this random question generator. There are hundreds of random questions to choose from so you're able to find the perfect random question to ask friends, family and people you want to get to know better.</p>
			</details>
			<details>
			  <summary>Do you include common questions?</summary>
			  <p>This generator doesn't include most common questions. The thought is that you can come up with common questions on your own so most of the questions in this generator are questions that elicit a bit more information that a typical common question.</p>
			</details>
			<details>
			  <summary>Can I use this for 21 questions?</summary>
			  <p>Yes! there are two ways that you can use this question generator depending on what you're after. You can indicate that you want 21 questions generated and you'll instantly have a random list of 21 questions to use. If you want to curate the 21 questions to use, you can spend some time on the generator until you find 21 questions you like, then use those the next time you play the 21 questions game.</p>
			</details>
			<details>
			  <summary>Are these questions for girls or for boys?</summary>
			  <p>The questions in this generator are gender neutral and can be used to ask either male of females (or any other gender the person identifies with). These questions were created to elicit interesting and thoughtful answers and aren't specific to a specific type of person.</p>
			</details>
		</div>
	</div>
</body>

<script type="text/javascript" src="index.js"></script>
</html>
              
            
!

CSS

              
                *,
*::before,
*::after {
	padding: 0;
	margin: 0;
	box-sizing: border-box;
}
body {
	background-color: #282828;
}
.page__wrapper {
	height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	font-family: "Syne Mono";
	flex-direction: column;
}
.heading {
	color: #fff;
	letter-spacing: 5px;
	font-size: 2.6em;
	margin-bottom: 30px;
	padding: 0px 15px;
}
.accordion {
	max-width: 500px;
	width: calc(100% - 20px);
}
details {
	background-color: #1E1E1E;
	margin-bottom: 10px;
	filter: drop-shadow(5px 5px 0px #0A0A0A);
}
details:hover {
	filter: drop-shadow(5px 5px 4px #0A0A0A);
}
details > summary {
	color: #f4de64;
	padding: 5px 10px;
	font-size: 1.3em;
	cursor: pointer;
}
details > p {
	padding: 5px 10px 10px 20px;
	color: #ddd;
	font-size: 1.1em;
}
              
            
!

JS

              
                
              
            
!
999px

Console