The goal is to use an unordered list where each dropdown in relative position contains a paragraph. I have the pseudocode :active working properly but am wondering if it's possible to toggle this drop down. Would a jQuery solution be best for this problem? Should I be using a button instead?
I am expecting each block a dropdown on click in relative position. This option would be toggleable.
.btn {
display: inline-flex;
padding: 0;
height: 50px;
border: none;
outline: none;
border-radius: 5px;
overflow: hidden;
font-size: 16px;
cursor: pointer;
background-color: #697180;
font-family: 'Quicksand', sans-serif;
margin-top: 10px;
transition: all 1s;
}
.btn:hover {
color: #e9eff8;
}
.coach_name,
.coach_school {
padding: 0 10px;
display: flex;
align-items: center;
}
.coach_school {
background: rgba(0, 0, 0, 0.08);
}
.coaches_bar ul {
list-style: none;
display: block;
padding: 10px;
}
.coaches_bar ul li {
margin-top: 10px;
}
.coaches_info {
display: none;
}
.coaches_bar ul li:active .coaches_info {
display: block;
position: relative;
color: var(--color-white);
margin-top: 10px;
}
.coaches_info ul {
display: block;
}
<div class="coaches_bar">
<ul>
<li>
<a class="btn">
<span class="coach_name">Cody Ferriero</span>
<span class="coach_school">Northeastern '14 Governors Academy '04</span
>
</a>
<div class="coaches_info">
<ul>
<li><p>Cody is a NEFPHL and Top Gun alumni. Cody played prep school hockey at Governor’s Academy. He went on to be a Division 1 scholarship hockey player at Northeastern University where he was given the Most Exciting Player Award in (2012-13). He was drafted 127th in the 2010 NHL Entry Draft by the San Jose Sharks. He played 2 years in the ECHL with the Rapid City Rush and the Utah Grizzlies. Cody is a CFSC (Certified Functional Strength Coach).</p></li>
</ul>
</li>
<li>
<a class="btn">
<span class="coach_name">Cody Ferriero</span>
<span class="coach_school">Northeastern '14 Governors Academy '04</span
>
</a>
<div class="coaches_info">
<ul>
<li><p>Cody is a NEFPHL and Top Gun alumni. Cody played prep school hockey at Governor’s Academy. He went on to be a Division 1 scholarship hockey player at Northeastern University where he was given the Most Exciting Player Award in (2012-13). He was drafted 127th in the 2010 NHL Entry Draft by the San Jose Sharks. He played 2 years in the ECHL with the Rapid City Rush and the Utah Grizzlies. Cody is a CFSC (Certified Functional Strength Coach).</p></li>
</ul>
</li>
</ul>
</div>