An id is an attribute used to specify a unique id for an HTML element. An ID selector is a name preceded by a hash character (“#”).

Id Breakdown

Here is the breakdown of HTML Id

Id Example

Below example will demonstrate the basic architecture of HTML Id.

<!doctype html>  
        <title>ID Example</title>
            #top {
                background-color: #ccc;
                padding: 20px

        <div id="top">