You can define an id in your HTML by adding the id
attribute to an element:
<div id="uniqueElement">This is a unique div.</div>
In your CSS, you can style the element using the hash (#) followed by the id name:
#uniqueElement { background-color: lightblue; }
This is a simple div with a unique id:
This div has an id of uniqueDiv
.
The following example shows how to style an element with an id:
This text is styled using the #uniqueDiv
id.
This example demonstrates how you can manipulate an element with JavaScript: