The NgStyle directive lets you set a given DOM elements style properties. One way to set styles is by using the NgStyle directive and assigning it an object literal , like so: HTML COPY < div [ngStyle] = " { ' background-color ' : ' green ' } " > </ < div > This sets the background color of the div to green