Ajout de la FAQ

This commit is contained in:
2023-01-05 16:14:34 +01:00
parent aee3325163
commit cbfafa3e74
3 changed files with 100 additions and 1 deletions

51
assets/css/faq.css Normal file
View File

@@ -0,0 +1,51 @@
h1 {
text-align: center;
}
h2 {
text-align: center;
font-size: medium;
}
.faq {
margin: 0 auto;
width: 500px;
}
.faq ul {
padding: 0;
list-style-type: none;
}
.faq ul li {
background: #f1f1f1;
padding: 10px 0;
margin-bottom: 10px;
position: relative;
}
.question {
font-size: 18px;
color: #47a3da;
text-decoration: none;
display: block;
padding: 0 0 0 20px;
position: relative;
}
.question:hover {
color: #000;
}
.question.active {
color: #000;
}
.faq ul li p {
display: none;
font-size: 14px;
color: #2f2f2f;
line-height: 24px;
padding: 10px 20px;
}

15
assets/js/faq.js Normal file
View File

@@ -0,0 +1,15 @@
let faqLink = document.querySelectorAll('.question');
faqLink.forEach(function(link) {
link.addEventListener('click', function() {
let faqCont = this.nextElementSibling;
if (faqCont.style.display === 'block') {
faqCont.style.display = 'none';
this.classList.remove('active');
} else {
faqCont.style.display = 'block';
this.classList.add('active');
}
});
});