Jennifer
Jennifer

Reputation: 905

Jade error producing nested classes

  .container-fluid('padding-bottom:15px;color:#fff')
    .row
        .col-md-6
            | column 1
        .col-md-6
            | column 2

what's wrong with my jade above?

Upvotes: 0

Views: 67

Answers (1)

Ivan
Ivan

Reputation: 1577

There are two errors in your example:

  1. Wrong indents.
  2. You can't set inline styles like that.

Try this

.container-fluid(style='padding-bottom:15px;color:#fff;')
  .row
    .col-md-6
        | column 1
    .col-md-6
        | column 2

It will compile to

<div style="padding-bottom:15px;color:#fff;" class="container-fluid">
  <div class="row">
    <div class="col-md-6">column 1</div>
    <div class="col-md-6">column 2</div>
  </div>
</div>

Otherwise you would get something like this

<div padding-bottom:15px;color:#fff="padding-bottom:15px;color:#fff" class="container-fluid">
  <div class="row">
    <div class="col-md-6">column 1</div>
    <div class="col-md-6">column 2</div>
  </div>
</div> 

Upvotes: 2

Related Questions