class attribute and css binding

32 views
Skip to first unread message

Wet Feet

unread,
Aug 25, 2017, 2:25:26 AM8/25/17
to KnockoutJS
What happens if I mix the HTML class attribute and also use the css binding in the same HTML element?

Would one override the other or they would merge together?

For example:

<style>
.italicized { font-style: italic; }
.bolded { font-weight: bold; }
</style>

<span class="italicized" data-bind="css: { bolded: true }">Sample Text</span>

So would the "Sample Text" end up:

  1. Italicized
  2. Italicized and bolded 
  3. Or just bolded 

Jean-Sebastien Binette

unread,
Sep 13, 2017, 6:32:01 AM9/13/17
to KnockoutJS
you get both.
Reply all
Reply to author
Forward
0 new messages