ID selectors

suggest change

ID selectors select DOM elements with the targeted ID. To select an element by a specific ID in CSS, the \# prefix is used.

For example, the following HTML div element…

<div id="exampleID">

…can be selected by #exampleID in CSS as shown below:

#exampleID {
    width: 20px;
Note: The HTML specs do not allow multiple elements with the same ID

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents