Skip to content
JS

Understand How to Style Angular Components

Course on egghead by Juri Strumpflohner

View on egghead (opens in a new tab)
24 min
LengthVideo runtime
Subscription
Price modelegghead plan
9
Lessons
4.3
Rating out of 513 ratings on egghead
Aug 2017
Published8 Aug 2017

About this course

Description from egghead

Developers usually have a love-hate relationship with CSS and styling user interfaces. But it is a fundamental part of creating nice-looking, adorable and successful user interfaces. In this course we will take a deep dive into the various possibilities Angular offers for styling components. We learn about the different APIs, how they allow us to conditionally apply one or multiple styles in the form of style attributes and CSS classes. We also explore the concept of style encapsulation and how it helps prevent our styles from leaking into other components.

What it covers

9 lessons
  1. 1Add styles to a component in Angular
  2. 2Style HTML elements in Angular using the style property
  3. 3Conditionally add a single CSS class to a DOM element in Angular
  4. 4Style HTML elements in Angular using ngClass
  5. 5Style HTML elements in Angular using ngStyle
  6. 6Use Angular style sanitization to mark dynamic styles as trusted values
  7. 7Use Angular’s @HostBinding and :host(...) to add styling to the component itself
  8. 8Use :host-context and the ::ng-deep selector to apply context-based styling
  9. 9Use the Renderer2 to add styles to an element in Angular

Similar Angular courses

  1. Create Dynamic Components in Angular

    egghead · Juri Strumpflohner · 7 lessons · 4.0 from 8 ratings · Dec 2017

    24 minSubscription
    egghead74.0 (8)Dec 2017
  2. Create Dynamic Forms in Angular

    egghead · Juri Strumpflohner · 7 lessons · 4.3 from 11 ratings · Dec 2017

    27 minSubscription
    egghead74.3 (11)Dec 2017
  3. SEO Friendly Progressive Web Applications with Angular Universal

    egghead · Bram Borggreve · 14 lessons · 4.7 from 5 ratings · Jul 2018

    28 minSubscription
    egghead144.7 (5)Jul 2018
  4. The 80/20 Rule - Build a strong AngularJS Foundation

    Master.dev · Lukas Ruebbelke · 2 lessons · Aug 2014

    17 minFree
    Master.dev2Aug 2014
  5. Server Side integration with AngularJS

    Master.dev · Lukas Ruebbelke · 2 lessons · Aug 2014

    15 minFree
    Master.dev2Aug 2014
  6. AngularJS In Action

    Master.dev · Lukas Ruebbelke · 2 lessons · Aug 2014

    12 minFree
    Master.dev2Aug 2014
  7. Intermediate1 h
    CourseraJul 2024
  8. Angular.js for Beginners: Directives

    Coursera · Shineta Horton, M. Ed · Jun 2023

    Beginner1 h 30 min
    CourseraJun 2023

A hyphen means the provider's catalogue does not state the value.

Same topic, nearest in length, up to three from any one provider.

Data read from the egghead catalogue on 28 Nov 2026. How the data is collected.

    Compare