The HTML id attribute is a unique characteristic, which is used to specify the HTML element or document. In CSS, the id is define by the symbol of #.
HTML id attribute Syntax
Let’s see the id syntax, which is given below:
<HTML element id=””></HTML element>
Example
<!DOCTYPE html> <html> <head> <title>HTML Id Attributes</title> <style> #nz { color:#009900; font-size:40px; font-weight:bold; text-align:center; } #netz { text-align:center; font-size:18px; } </style> </head> <body> <div id="nz">Netzole Pvt Ltd</div> <div id="netz">Netzole is a technologies based company</div> </body> </html>
Output
Netzole Pvt Ltd
Netzole is a technologies based company