Techno

CSS id | Multiple Id

CSS id is the name(id or identity id ) of the block of code by which we called the CSS block of code. You can call a CSS block code via the CSS id. Without CSS id you can't call the CSS in HTML. Every block of code has a different CSS id name. CSS id name is not similar to another CSS id. We can create multiple CSS id. Every id name has different properties. CSS id is a unique identifier of the CSS block. If you don't want to use CSS id then you can use CSS class . CSS class is similar to the CSS ID but there is a small difference in class and id.
A website can contain the multiple CSS id. The developers create the CSS id according to website design. Multiples CSS id have different effects on DOM (HTML structure).

CSS calss syntax


#id-name{

}

CSS id name is written with .(dot) and id-name . The id name may be anything. You can choose according to your need. If you are working on Header then you can take CSS id name as #header. if you are working on the body then you can take as #body etc.

Create a Simple CSS id

Creating a id according to your need . The following example will show you, how to create CSS id using CSS attributes and Property


#header{
height:200px; 
width:800px; 
background-color:grey; 
color:white ; 

}

We have create a simple header id and use some CSS attributes and Property.
Now call the css id in HTML to see the effect .

CSS id call in HTML

Calling CSS id is very simple you have to use div element and simple class .

CSS id in HTML


<!DOCTYPE>
<html>
<head>
<title>CSS id   </title>

<head>


</body>
</head>
</html>
Run

In above example we have called the CSS by its id name .

CSS Multiples id

A website can contain Multiple CSS id . Multiple id have diffrent properties .

Multiple id in HTML


<!DOCTYPE>
<html>
<head>
<title>CSS Multiple id in HTML  </title>

<head>



 
</body>
</head>
</html>
Run

In above example we have create multiple id . 1. header 2. footer . Also we have called the multiple id in HTML using div block or id.