سوالات متداول
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
}
.container {
max-width: 600px;
margin: auto;
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
padding: 20px;
}
h1 {
text-align: center;
color: #333;
}
.faq-item {
margin-bottom: 10px;
}
.faq-question {
background-color: #007bff;
color: white;
padding: 15px;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.faq-question:hover {
background-color: #0056b3;
}
.faq-answer {
display: none;
padding: 10px;
border: 1px solid #007bff;
border-radius: 5px;
margin-top: 5px;
overflow: hidden;
max-height: 0;
transition: max-height 0.3s ease, padding 0.3s ease;
}
document.querySelectorAll(‘.faq-question’).forEach(question => {
question.addEventListener(‘click’, () => {
const answer = question.nextElementSibling;
// Toggle the display of the answer
if (answer.style.maxHeight) {
answer.style.maxHeight = null;
answer.style.padding = ‘0’;
answer.style.display = ‘none’;
} else {
answer.style.maxHeight = answer.scrollHeight + “px”;
answer.style.padding = ’10px’;
answer.style.display = ‘block’;
}
});
});