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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <footer><a href="https://twitter.com/Connor_Gaunt" target="_blank">Twitter: @Connor_Gaunt</a></footer>
<div class="FAQ">
	<header>
		<h2>FAQ</h2>
	</header>
<div class="questionSection">
		<div class="question">
			<h3>Question 1</h3>
			<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/153207/arrow.png">
		</div>
		<div class="answer">
			<p>Phasellus eget lectus felis. Nullam ultrices, dolor eget egestas euismod, ex erat tempus nibh, sit amet maximus enim lectus lobortis eros. Aenean faucibus et ipsum a sollicitudin. Ut tincidunt mattis vehicula. In feugiat justo ac lectus sodales luctus. Phasellus et dolor quis erat congue lobortis in vel sem. Aenean tortor nulla, varius at nisl eget, dignissim venenatis massa. Sed imperdiet sit amet ipsum pretium varius.</p>
		</div>
	</div>

<div class="questionSection">
		<div class="question">
			<h3>Question 2</h3>
			<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/153207/arrow.png">
		</div>
		<div class="answer">
			<p>Phasellus eget lectus felis. Nullam ultrices, dolor eget egestas euismod, ex erat tempus nibh, sit amet maximus enim lectus lobortis eros. Aenean faucibus et ipsum a sollicitudin. Ut tincidunt mattis vehicula. In feugiat justo ac lectus sodales luctus. Phasellus et dolor quis erat congue lobortis in vel sem. Aenean tortor nulla, varius at nisl eget, dignissim venenatis massa. Sed imperdiet sit amet ipsum pretium varius.</p>
		</div>
	</div>
	
<div class="questionSection">
		<div class="question">
			<h3>Question 3</h3>
			<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/153207/arrow.png">
		</div>
		<div class="answer">
			<p>Phasellus eget lectus felis. Nullam ultrices, dolor eget egestas euismod, ex erat tempus nibh, sit amet maximus enim lectus lobortis eros. Aenean faucibus et ipsum a sollicitudin. Ut tincidunt mattis vehicula. In feugiat justo ac lectus sodales luctus. Phasellus et dolor quis erat congue lobortis in vel sem. Aenean tortor nulla, varius at nisl eget, dignissim venenatis massa. Sed imperdiet sit amet ipsum pretium varius.</p>
		</div>
	</div>
	
<div class="questionSection">
		<div class="question">
			<h3>Question 4</h3>
			<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/153207/arrow.png">
		</div>
		<div class="answer">
			<p>Phasellus eget lectus felis. Nullam ultrices, dolor eget egestas euismod, ex erat tempus nibh, sit amet maximus enim lectus lobortis eros. Aenean faucibus et ipsum a sollicitudin. Ut tincidunt mattis vehicula. In feugiat justo ac lectus sodales luctus. Phasellus et dolor quis erat congue lobortis in vel sem. Aenean tortor nulla, varius at nisl eget, dignissim venenatis massa. Sed imperdiet sit amet ipsum pretium varius.</p>
		</div>
	</div>

<div class="questionSection">
		<div class="question">
			<h3>Question 5</h3>
			<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/153207/arrow.png">
		</div>
		<div class="answer">
			<p>Phasellus eget lectus felis. Nullam ultrices, dolor eget egestas euismod, ex erat tempus nibh, sit amet maximus enim lectus lobortis eros. Aenean faucibus et ipsum a sollicitudin. Ut tincidunt mattis vehicula. In feugiat justo ac lectus sodales luctus. Phasellus et dolor quis erat congue lobortis in vel sem. Aenean tortor nulla, varius at nisl eget, dignissim venenatis massa. Sed imperdiet sit amet ipsum pretium varius.</p>
		</div>
	</div>
	
<div class="questionSection">
		<div class="question">
			<h3>Question 6</h3>
			<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/153207/arrow.png">
		</div>
		<div class="answer">
			<p>Phasellus eget lectus felis. Nullam ultrices, dolor eget egestas euismod, ex erat tempus nibh, sit amet maximus enim lectus lobortis eros. Aenean faucibus et ipsum a sollicitudin. Ut tincidunt mattis vehicula. In feugiat justo ac lectus sodales luctus. Phasellus et dolor quis erat congue lobortis in vel sem. Aenean tortor nulla, varius at nisl eget, dignissim venenatis massa. Sed imperdiet sit amet ipsum pretium varius.</p>
		</div>
	</div>
	
	

</div>
              
            
!

CSS

              
                *
	box-sizing: border-box
	margin: 0
	padding: 0
	font-family: sans-serif

body
	background-color: #16598c
	position: relative



footer
	position: fixed
	bottom: 0
	width: 100%
	background-color: #2591e5
	text-align: right
	padding: 5px 10px
	a
		text-decoration: none
		color: white
		letter-spacing: 0.8px
		font-size: 13px

.FAQ
	max-width: 400px
	margin: 50px auto

	header
		background-color: #2591e5
		padding: 10px 10px
		border: 1px solid #2591e5
		
		h2
			color: white
			font-weight: 300
			letter-spacing: 2px
	
	.questionSection
		width: 100%

		&.active
			.question
				img
					transform: rotate(90deg)
			.answer
				padding: 10px
				border-top: 1px solid #2591e5
				max-height: 1000px

		&:last-child
			border-bottom: 1px solid #2591e5
			&.active
				border-bottom: 0
	
	
		.question
			width: 100%
			padding: 2px
			border: 1px solid #2591e5
			border-bottom: none
			background-color: white
	
			h3
				padding: 10px
				display: inline-block
				letter-spacing: 1px
				color: #135282
				font-weight: normal

			img
				float: right
				width: 40px
				position: relative
				top: 1px
				transform: rotate(0)
				transition: transform 0.5s ease
	
			&:hover
				cursor: pointer
				img
					transform: rotate(45deg)
	
		.answer
			border: 1px solid #2591e5
			border-top: none
			border-bottom: none
			padding: 0px
			background-color: white
			max-height: 0px
			overflow: hidden
			transition: 0.5s ease
			box-shadow: inset 0px 3px 10px -3px rgba(0,0,0,0.3), inset 0px -3px 10px -3px rgba(0,0,0,0.3)
	
			p
				color: #135282
				font-size: 14px
				/* text-shadow: 1px 1px 0px #007eaa */
				letter-spacing: 1px
	
              
            
!

JS

              
                $(document).ready(function(){
	$(".questionSection").on("click", function(){
		if(!$(this).hasClass("active")){
			$(".questionSection").removeClass("active");
			$(this).addClass("active");
		} else {
			$(".questionSection").removeClass("active");
		}
	});
})
              
            
!
999px

Console