Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS #id selector

CSS #id Selector

Complete CSS SelectorComplete CSS Selector Reference Manual

Example

Add a specified style to the element with id="firstname":

#firstname

{

background-color:yellow;

}

Try it »


Definition and Usage

#idThe selector specifies the style of an element with an ID.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support #id selector.


Complete CSS SelectorComplete CSS Selector Reference Manual