كود الاسئلة الشائعة عربية

ادمج الاسئلة مع اجوبتها كاملة في هذا الكود

<style>
.faq-container {
  max-width: 800px;
  margin: 40px auto;
  font-family: Arial, sans-serif;
  direction: rtl; 
  text-align: right; 
}
.faq-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
}
.faq-item {
  margin-bottom: 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: #f0f0f0;
  border: none;
  outline: none;
  padding: 15px;
  font-size: 16px;
  font-weight: bold; /* جعل السؤال بخط عريض */
  text-align: right; 
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease;
}
.faq-question::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  border-right: 2px solid #333;
  border-bottom: 2px solid #333;
  transition: transform 0.3s ease;
}
.faq-question.active::after {
  transform: translateY(-50%) rotate(135deg);
}
.faq-answer {
  max-height: 0;
  padding: 0 15px;
  overflow: hidden;
  background: #fff;
  font-weight: normal; /* النص العادي للإجابات */
  transition: max-height 0.4s ease, padding 0.3s ease;
}
.faq-answer.open {
  padding: 15px;
  max-height: 500px;
}
</style>

<div class="faq-container">
  <div class="faq-title">الأسئلة الشائعة</div>

  <!-- هنا يمكنك إضافة الأسئلة -->
  <!--
  <div class="faq-item">
    <button class="faq-question">السؤال هنا</button>
    <div class="faq-answer">الإجابة هنا</div>
  </div>
  -->
</div>

<script>
document.querySelectorAll('.faq-question').forEach((btn, idx) => {
  btn.addEventListener('click', function () {
    const answer = this.nextElementSibling;
    const isOpen = answer.classList.contains('open');

    document.querySelectorAll('.faq-answer').forEach(a => a.classList.remove('open'));
    document.querySelectorAll('.faq-question').forEach(q => q.classList.remove('active'));

    if (!isOpen) {
      answer.classList.add('open');
      this.classList.add('active');
    }
  });

  if (idx === 0) {
    btn.classList.add('active');
    btn.nextElementSibling.classList.add('open');
  }
});
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    /* هنا يمكنك إضافة الأسئلة بصيغة JSON لاحقًا */
  ]
}
</script>

كاتب المقال محمد بلقاسم

محمد ذويب، مدون مهتم بالربح من الإنترنت، العملات الرقمية، والتسويق الإلكتروني. أشارك شروحات ودروسًا تساعد المبتدئين على تحقيق دخل عبر الإنترنت.

Previous Post Next Post

نموذج الاتصال