Pages

Thursday, March 22, 2012

ID in CSS


ID

ID is specified by including a number sign (#) before the selector name.
The syntax for declaring an ID selector is as follows:

#[ID Name] {
  property:value;
  ...
}

For example,

#footer {
color:#bbbbbb;
}

To apply this style to the HTML, using the following code:

 <html>
<head> <title> </title>
</head>
<body>
<p id="footer">This is a sample using an ID selector.</p>
</body>
</html>

The above HTML code renders:

No comments:

Post a Comment