VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/how-to-append-angular-styles-in-footer/

⇱ How to append Angular styles in footer ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to append Angular styles in footer ?

Last Updated : 12 Jul, 2025
To append CSS styles to footer or any HTML element with angularJS, we can either use ng-class directive if we have a predefined CSS class, or ng-style directive if we want to dynamically create styles in runtime. Syntax:
<footer ng-style="jsObject">...</footer>
OR
<footer ng-class="jsObject/Array/String">...</footer>
In the ng-style directive, the jsObject contains the CSS key-value pairs. In the ng-class directive, the expression can be a jsObject, Array or String. Here the jsObject is a key-value pair mapping of a CSS class name and a boolean, String is just the name of CSS class while Arrays can be both. Example 1: In this example, we use ng-style directive to append styles to footer element. Output: When we press the button GFG, it will call the click function. The click function then changes the value of styleObj by giving it a new property and modifying the existing one. Example 2: In this example, we use ng-class directive with an object to append styles to the footer element. Output:
Comment
Article Tags:

Explore