--- title: Override Class Declarations by Styling ID Attributes --- ## Override Class Declarations by Styling ID Attributes In order to understand overriding in CSS, you must first understand the principle of precendence in CSS. The key rule to remember is that CSS is read from the bottom to top. An example of this is: ```html

Example

``` In the example above, the text `Example` will be in blue because the last added class was `blue-text`. It is key to remember that an `id` attribute will take precedence over classes, meaning that it ranks highest. You can create an `id` attribute by adding the `#` before the name of the class, like below: ```html ``` Here is an example to show you how to Override Class Declarations by Styling ID Attributes: ```html

Example

``` This will make the text `Example` be green because the `id` attribute will always take precedence over `class` declarations.