Vue · Junior · Question 55 of 75

How do you bind several inline styles from an object?

<div :style="{ color: textColor, fontSize: size + 'px' }"></div>

Explanation

:style also accepts an array of objects. Vue adds vendor prefixes when needed.

Further reading

Problem with a question

Vue · Junior · question 55

Test yourself

Take the Vue · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz