@ -18,8 +18,7 @@ section#about:hover { color: blue; }
|
|||||||
div.classname#specified_id { color: green; }
|
div.classname#specified_id { color: green; }
|
||||||
```
|
```
|
||||||
### Note about IDs
|
### Note about IDs
|
||||||
|
ID should be avoided when styling if possible. As it has high specificity and it can be overriden only if you use inline styles, or add styles into ```<style>``` tags in the HTML. The weight of IDs override class selectors and type selectors.
|
||||||
ID should be avoided when styling if possible. As it has high specificity and it can be overriden only if you inline styles, or add styles into ```<style>```. The weight of ID overrides class selectors and type selectors.
|
|
||||||
|
|
||||||
Remember, the ID selector must match an HTML element's ID attribute.
|
Remember, the ID selector must match an HTML element's ID attribute.
|
||||||
```html
|
```html
|
||||||
|
Reference in New Issue
Block a user