English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Complete CSS Selector Reference Manual
For id="my-id" element adds the specified style:
<!DOCTYPE html> <html> <title>Basic Tutorial Website (oldtoolbag.com)</title>/title> <head> <style> #my-id { background-color:red; } </style> </head> <body> <h1>Welcome to my homepage</h1> <div id="my-id"> <p>My name is Rabbit Baby.</p>/p> <p>I live in Canada.</p>/p> </div> <p>My best friend is Lili.</p>/p> </body> </html>Test and see ‹/›
#idThe selector specifies the style of elements with ID attributes.
IEFirefoxOperaChromeSafari
All mainstream browsers support #id Selector.