FAQ

In this example below you will see how to do a FAQ with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by -Infamous, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright -Infamous ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>FAQ</title>
  
  
  <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'>

      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div class="container-fluid no-padding">
  <div class="col-xs-12 center-center landing-image">
    <span class="landing-text">frequently asked questions</span>
  </div>
  <div class="col-xs-12 toggle-wrap">
    <div class="col-xs-4 center-center employer-toggle" :class="{ 'toggle-active' : isEmployer}" @click="isEmployer = true; isEmployee = false; isOther = false">
      <span>posting a job</span>
    </div>
    <div class="col-xs-4 center-center employee-toggle" :class="{ 'toggle-active' : isEmployee}" @click="isEmployer = false; isEmployee = true; isOther = false">
      <span>looking for a job</span>
    </div>
    <div class="col-xs-4 center-center other-toggle" :class="{ 'toggle-active' : isOther}" @click="isEmployer = false; isEmployee = false; isOther = true">
      <span>useful information</span>
    </div>
  </div>
  <div class="col-xs-12 center-center faq-content">
    <div class="col-xs-10" v-if="isEmployer">
      <h1>Employer details and faq's</h1>
      <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
      <ul>
        <li>point 1</li>
        <li>point 2</li>
        <li>point 3</li>
      </ul>
    </div>
    <div class="col-xs-10" v-if="isEmployee">
      <h1>Employee details and faq's</h1>
      <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
      <ul>
        <li>example 1</li>
        <li>example 2</li>
        <li>example 3</li>
      </ul>
    </div>
    <div class="col-xs-10" v-if="isOther">
      <h1>Other details and faq's</h1>
      <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
      <ul>
        <li>explain 1</li>
        <li>explain 2</li>
        <li>explain 3</li>
      </ul>
    </div>
  </div>
</div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.3/vue.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/-Infamous/faq-pVErXP */
.no-padding {
  margin: 0;
  padding: 0;
}

.center-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-image {
  height: 350px;
  background-image: url(https://sebenza.beta.mad9000.com/assets/images/terms-header-image.jpg);
  background-position: center center;
  background-size: 100% auto;
  background-repeat: no-repeat;
}

.landing-text {
  font-size: 42px;
  color: #fff;
  text-transform: uppercase;
  text-align: center;
}

.toggle-wrap {
  height: 50px;
  margin-top: 10px; 
  margin-bottom: 10px;
}

.employer-toggle,
.employee-toggle,
.other-toggle {
  height: 100%;
  border-radius: 2px;
  color: #000;
  text-transform: uppercase;
  font-size: 18px;
  cursor: pointer;
}

.toggle-active {
  background: #71d5ff;
  background: -webkit-linear-gradient(left, #71d5ff #41b5f4);
  background: -o-linear-gradient(right, #71d5ff, #41b5f4);
  background: -moz-linear-gradient(right, #71d5ff, #41b5f4);
  background: linear-gradient(to right, #71d5ff, #41b5f4);
  color: #FFF;
}


/*Downloaded from https://www.codeseek.co/-Infamous/faq-pVErXP */
new Vue({
  el: '.container-fluid',
  data: {
    isEmployer: true,
    isEmployee: false,
    isOther: false
  }
});

Comments