Home
CSS
CSS Specificity
Tryit: ID selectors have a higher specificity than attribute selectors
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> div#myDiv {background-color: green;} #myDiv {background-color: yellow;} div[id=myDiv] {background-color: blue;} </style> </head> <body> <div id="myDiv">This is a div</div> </body> </html>