Accordion

Headline for Content 1

content...

Headline for Content 2

content...

Headline for Content 3

content...

Headline for Content 4

content...

HTML

							
							
<div id="accordion">
	<div>
		<input type="checkbox" checked name="tab-1" id="tab-1">
		<label for="tab-1">Tab 1</label>
		<div class="tab-content">
			<h3>>Headline for Content 1</h3>
			<p>content...</p>
		</div>  
	</div>

	<div>
		<input type="checkbox" name="tab-2" id="tab-2">
		<label for="tab-2">Tab 2</label>
		<div class="tab-content">
			<h3>>Headline for Content 2</h3>
			<p>content...</p>
		</div>  
	</div>
	
	<div>
		<input type="checkbox" name="tab-3" id="tab-3">
		<label for="tab-3">Tab 3</label>
		<div class="tab-content">
			<h3>>Headline for Content 3</h3>
			<p>content...</p>
	  	</div>  
	</div>
	<div>
		<input type="checkbox" name="tab-4" id="tab-4">
		<label for="tab-4">Tab 4</label>
		<div class="tab-content">
			<h3>>Headline for Content 4</h3>
			<p>content...</p>
	  	</div>  
	</div>
</div>
							
						

CSS

							
							
#accordion {
  background-color: #e0e0e0;
  max-width: 100%;
}

input[type=checkbox] {
  display: none;
}
label {
  position: relative;
  display: block;
  background-color: #a25f5e;
  color: #FFFFFF;
  padding: 1em;
  cursor: pointer;
  border-bottom: 1px solid #d0d0d0;
}

label:after {
  content: "+";
  position: absolute;
  right: 1em;
  font-size: 0.85em;
}
input:checked + label:after {
  content: "-";
}
.tab-content {
  transition: height 0.15s ease-out 0s;
  width: 100%;
}

.tab-content * {
  padding-left: 16px;
}
input:not(:checked) ~ .tab-content {
  height: 0px;
  overflow: hidden;
}

input:checked ~ .tab-content {
  height: 150px;
}