Each record is being skewed to the right of the previous one.

Omar Martin
Omar Martin used Ask the Experts™
on
Record
I am using the "each statement" with the handlebars template engine in node.js.  Unfortunately, each record is being tabbed to the right of the previous one, as the attach image shows. I would like each record to line up evenly.
Please see the code:

Here is the file:gigs.handlebars

{{#each gigs}}
<section id="gigs" class="container">
<!--<h1>All Gigs</h1>-->
<h1>{{equipment_area}}</h1>
<div class="gig">
      <h3>{{title}}</h3>
      <!--<p>{{manufacturer}}</p>-->
      <ul>
        <!--<li>Budget: {{budget}}</li>-->
        <!--<li><a href="mailto:{{contact_email}}" class="btn btn-reverse">Apply Now</a></li>-->
        <li>Equipment Type: {{equipment_type}}</li>
        <li>Manufacturer: {{manufacturer}}</li>
        <li>Model Number: {{model_number}}</li>
        <li>Serial Number: {{serial_number}}</li>
        <li>Condition: {{severity}}</li>
        <li>Comments: {{general_comments}}</li>
                
      </ul>
      <!--
      <div class="tech">
        <small>Technologies Needed: <span>{{technologies}}</span></small>
      </div>
      -->
    </div>
    {{else}}
     <p>No gigs available</p>
    {{/each}}
</section>

Open in new window


Please also see the css file:
@import url('https://fonts.googleapis.com/css?family=Lato');

:root {
  --primary-color: #568c9b;
  --primary-hover-color: #64a5b7;
  --bg-color: #333;
  --box-shadow: 3px 4px 12px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Lato', sans-serif;
  margin: 0;
  color: #333;
  background: #f4f4f4;
}

ul {
  list-style: none;
  padding: 0;
}

a {
  color: #fff;
  text-decoration: none;
}

a:hover {
  color: var(--primary-color);
}

.container {
  /*max-width: 960px;*/
  max-width: 1200px;
  padding: 1rem 4rem;
  margin: auto;
  /*overflow: hidden;*/
}

.error {
  padding: 5px;
  border: #777 dotted 1px;
  margin-bottom: 15px;
}

/* Header */
header {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 6rem;
}

header nav ul {
  display: flex;
}

header nav li {
  margin: 0 1rem;
}

/* Login Button Spacing */
/*header nav li:last-child {
  margin-left: -5px;
}*/

header.inner {
  background: var(--bg-color);
  border-bottom: 4px solid var(--primary-color);
  position: relative;
  box-shadow: var(--box-shadow);
}

/* Buttons */
.btn {
  color: #fff;
  padding: 0.6rem;
  border: 1px solid #ccc;
  transition: all 0.7s;
}

.btn:hover {
  background: var(--primary-color);
  border: 1px solid var(--primary-color);
  color: #fff;
}

.btn-reverse {
  background: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-reverse:hover {
  background: var(--primary-hover-color);
  border: 1px solid var(--primary-hover-color);
}

/* Home Search */
.search-wrap {
  background: url('../img/showcase.jpg') no-repeat center center fixed / cover;
  height: 100vh;
  width: 100%;
  padding: 1.3rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.search-wrap h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 1.5rem;
  text-align: center;
}

.search-form input[type='submit'] {
  background: var(--primary-color);
  border: 1px solid var(--primary-color);
  color: #fff;
  padding: 0 2rem;
  cursor: pointer;
  transition: all 0.8s;
}

.search-form input[type='submit']:hover {
  background: var(--primary-hover-color);
  border: 1px solid var(--primary-hover-color);
}

.search-form {
  display: flex;
  width: 600px;
  box-shadow: var(--box-shadow);
}

.search-form i {
  color: #333;
}

/* Everything in the search form */
.search-form > * {
  border: 0;
  padding: 0 0 0 10px;
  background: #fff;
  line-height: 50px;
  font-size: 1rem;
  border-radius: 0;
  outline: 0;
}

input[type='search'] {
  flex-basis: 600px;
}

/* Gigs */
.gig {
  background: var(--bg-color);
  border-bottom: 4px solid var(--primary-color);
  color: #fff;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--box-shadow);
}

.gig ul {
  list-style: none;
  display: flex;
}

.gig li {
  margin-right: 0.5rem;
  padding: 0.6rem;
}

.gig .tech span {
  color: var(--primary-color);
}

/* Form */
.form-wrap {
  margin: auto;
  background: var(--bg-color);
  color: #fff;
  padding: 1rem 3rem 3rem;
  margin-top: 3rem;
  border-bottom: 4px solid var(--primary-color);
  box-shadow: var(--box-shadow);
}

.form-wrap.reg-form,
.form-wrap.login-form {
  width: 60%;
}

.form-wrap h1,
.form-wrap h2,
.form-wrap p {
  text-align: center;
}

.form-wrap .btn {
  margin-top: 1rem;
  display: block;
  width: 100%;
  text-align: center;
  font-size: 18px;
}

label {
  display: block;
  margin-bottom: 0.5rem;
}

.input-box {
  padding: 0.5rem;
  font-size: 18px;
  width: 100%;
  margin-bottom: 1.2rem;
}

/* Tablets */
@media (max-width: 800px) {
  .container {
    padding: 1rem 2rem;
  }

  header {
    flex-direction: column;
    padding: 0.3rem !important;
  }

  .search-form {
    width: 100%;
  }

  input[type='search'] {
    flex-basis: 100%;
  }

  .search-wrap h1 {
    font-size: 2rem;
  }

  .search-wrap {
    padding: 2.3rem;
  }

  .gig ul {
    flex-direction: column;
  }

  .gig .btn {
    display: block;
    margin-top: 1rem;
    text-align: center;
  }

  .form-wrap.reg-form,
  .form-wrap.login-form {
    width: 80%;
  }
}

/* Smartphones */
@media (max-width: 500px) {
  .container {
    padding: 1rem;
  }

  header nav li {
    margin: 0 10px;
  }

  .search-form {
    display: flex;
    flex-direction: column;
  }

  input[type='search'] {
    flex-basis: 0;
  }

  .search-form i {
    display: none;
  }

  .form-wrap {
    padding: 1rem 2rem 2rem;
  }

  .form-wrap.reg-form,
  .form-wrap.login-form {
    width: 100%;
  }
}

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Bridgemaker
Commented:
I had to move the container outside of the each statement. It works now.

<section id="gigs" class="container"></section>
{{#each gigs}}
<!--<h1>All Gigs</h1>-->
<h1>{{equipment_area}}</h1>
<div class="gig">

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial