Rendy Rendy - 1 year ago 89
Jade Question

1 line with 2 different class in Jade?

I have following code

td(class="fieldText") Others Please Specify


I want to put different style on
Please Specify
.

How am I able to do it in 1 line?

Answer Source

You can use the <span> element to do that:

.fieldText {
  font-size:10px
}

.otherText {
  font-size:50px
}
<!--

Jade/pug:

td(class="fieldText") Others 
  span(class="otherText") Please Specify


which outputs as:
-->

<td class="fieldText">Others <span class="otherText">Please Specify</span></td>