i have a form to be displayed in HTML format, the form HTML code is like below:

```html
<form action="<?php echo base_url('editAllProductsAction'); ?>" method="post">
  <?php foreach($products as $key=>$val){ ?>
  <div class="row">
    <h5></h5>
    <input type="hidden" value="<?php echo $val['id']; ?>" name="id[]" />
    <div class="col-lg-3">
      <label>Product Name</label>
      <input name="product_name[]" value="<?php echo $val['product_name']; ?>" type="text" class="form-control" />
    </div>
    <div class="col-lg-3">
      <label>Min Qty </label>
      <select name="min_qty[]" class="form-control">
        <?php for($i=1;$i<50;$i++){ ?>
        <option <?php if($i==$val[ 'min_qty']) echo 'selected'; ?> value="
          <?php echo $i; ?>">
          <?php echo $i; ?>
        </option>
        <?php }?>
      </select>
    </div>
    <div class="col-lg-3">
      <label>Purchase Price </label>
      <input name="purchase_price[]" value="<?php echo $val['purchase_price']; ?>" type="number" data-id="<?php echo $val['id']; ?>" class="form-control edit_purchase_price" />
    </div>
    <div class="col-lg-3">
      <label>Nosh Price </label>
      <input name="nosh_price[]" value="<?php echo $val['nosh_price']; ?>" type="number" class="form-control edit_nosh_price_<?php echo $val['id']; ?>" />
    </div>
  </div>
  <?php } ?>
  <button type="submit" class="btn btn-primary right_side">Submit</button>
</form>
```

as you can see I have used php to display the values in the form, when I am displaying the form, because all the row is having same white color as background like below, which is awkward:

[![enter image description here](https://i.stack.imgur.com/R7uAW.png)](https://i.stack.imgur.com/R7uAW.png)

I am trying to give 2 background colors for the form, like in first row all input background color will display one color, the second row all the input background will show different colors and it continues for each row. i did the following css:

```css
.form-control:nth-child(2n+1) {
  background-color: grey;
}
```

but this is not displaying the color, can anyone tell me what I did wrong here. thanks in advance