Skip to content

Commit 3874fde

Browse files
Merge pull request #2053 from shubhIam-dev/shubh/fixfaq
allow FAQ items to be closed by switching from radio to checkbox input
2 parents b664368 + 1e1f3b1 commit 3874fde

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

Projects/FAQ Page/faq_page.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ body{
3737
display: flex;
3838
gap: 1rem;
3939
align-items: center;
40+
margin-top: 10px;
4041
cursor: pointer;
4142
}
4243

@@ -68,10 +69,16 @@ body{
6869
transform: rotate(135deg);
6970
}
7071

71-
.stack input{
72+
/* .stack input{
7273
appearance: none;
74+
} */
75+
.stack input {
76+
position: absolute;
77+
opacity: 0;
78+
width: 100%;
79+
height: 100%;
80+
z-index: 2;
7381
}
74-
7582
.content{
7683
max-height: 0;
7784
overflow: hidden;

Projects/FAQ Page/faq_page.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111
<div class="container">
1212
<h1>Frequently Asked Questions</h1>
1313
<div class="stack">
14-
<input type="radio" name="faq" id="faq1">
14+
<input type="checkbox" name="faq" id="faq1">
1515
<label for="faq1">
1616
<h2>01</h2>
1717
<h3>How do I apply?</h3>
1818
</label>
19+
1920
<div class="content"><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis molestias consequatur, illo provident nostrum repellendus officia, laudantium magnam eius, libero eaque consectetur labore? Aspernatur laudantium rem iure optio commodi ea.</p></div>
2021
</div>
2122

2223
<div class="stack">
23-
<input type="radio" name="faq" id="faq2">
24+
<input type="checkbox" name="faq" id="faq2">
2425
<label for="faq2">
2526
<h2>02</h2>
2627
<h3>How do I apply?</h3>
@@ -29,7 +30,7 @@ <h3>How do I apply?</h3>
2930
</div>
3031

3132
<div class="stack">
32-
<input type="radio" name="faq" id="faq3">
33+
<input type="checkbox" name="faq" id="faq3">
3334
<label for="faq3">
3435
<h2>03</h2>
3536
<h3>How do I apply?</h3>
@@ -38,7 +39,7 @@ <h3>How do I apply?</h3>
3839
</div>
3940

4041
<div class="stack">
41-
<input type="radio" name="faq" id="faq4">
42+
<input type="checkbox" name="faq" id="faq4">
4243
<label for="faq4">
4344
<h2>04</h2>
4445
<h3>How do I apply?</h3>
@@ -47,7 +48,7 @@ <h3>How do I apply?</h3>
4748
</div>
4849

4950
<div class="stack">
50-
<input type="radio" name="faq" id="faq5">
51+
<input type="checkbox" name="faq" id="faq5">
5152
<label for="faq5">
5253
<h2>05</h2>
5354
<h3>How do I apply?</h3>

0 commit comments

Comments
 (0)