Voici mon code HTML il marche parfaitement pour l'usage dont j'ai besoins le seul probléme c'est que j'aimerais que les section "QUESTION 1", "QUESTION 2"... se referment lorqu'on rappuie sur la question. Je suis débutante et je n'arrive pas trouver la solution si quelq'un peut me donner un coup de main s'il vous plait ?
Bonne journée
Bonne journée
<style type="text/css"><!--
.faq {
position: relative;
}
.faq input { display: none; }
.faq input:checked + label {
background: -webkit-linear-gradient(top,#f00433,#f00433);
color: none;
font-size:100%;
font-weight: bold;
}
.faq label {
font-family: helvetica;
cursor: pointer;
display: block;
height: auto;
text-align: left;
padding:15px;
padding-left:15px;
margin:0;
padding-right: 15px;
color: #333;
font-size:100%;
border:1px solid none;
border-bottom: 0;
font-weight: bold;
background: -webkit-linear-gradient(top,#04abf2,#04abf2);
}
.faq label:before {
content:"+";
line-height:21px;
font-size:21px;
margin-right:5px;
}
.faq input:checked + label:before {
content:"-";
}
.faq label:last-child { margin-right: 0; }
.faq label:hover {
background: -webkit-linear-gradient(top,#eee,#ddd);
}
.faq article {
max-height: 0;
overflow: hidden;
transition: max-height 0.15s ease-out;
position: relative;
margin-bottom: 0;
top:0;
padding:10px 10px 10px 10px;
color: #fcfdfd;
opacity: 0;
border:1px solid none;
}
.faq div > input:checked ~ article {
max-height: 500px;
opacity: 1;
margin-bottom:12px;
transition: max-height 0.25s ease-in;
}?
--></style>
<form class="faq">
<div class="faq-wrapper"><input type="radio" name="size" id="faq1" value="faq1" /> <label for="faq1">QUESTION 1</label>
<article>
<p>REPONSE 1</p>
</article>
</div>
<div class="faq-wrapper"><input type="radio" name="size" id="faq2" value="faq2" /> <label for="faq2">QUESTION 2</label>
<article>
<p>REPONSE 2</p>
</article>
</div>
<div class="faq-wrapper"><input type="radio" name="size" id="faq3" value="faq3" /> <label for="faq3">QUESTION 3</label>
<article>
<p>REPONSE 3</p>
</article>
</div>
<div class="faq-wrapper"><input type="radio" name="size" id="faq4" value="faq4" /> <label for="faq4">QUESTION 4 </label>
<article>
<p>REPONSE 4</p>
</article>
</div>
<div class="faq-wrapper"><input type="radio" name="size" id="faq5" value="faq5" /> <label for="faq5">QUESTION 5</label>
<article>
<p>REPONSE 5</p>
</article>
</div>
</form>