Computer >> Computer tutorials >  >> Programming >> CSS

Element Type Selector in CSS


The CSS element type selector is used to select all elements of a type. The syntax for CSS element type selector is as follows

Syntax

element {
   /*declarations*/
}

Example

The following examples illustrate CSS element type selector

<!DOCTYPE html>
<html>
<head>
<style>
li {
   list-style: none;
   margin: 5px;
   border-bottom-style: dotted;
}
div {
   box-shadow: inset 0 0 8px plum;
   padding: 36px;
}
</style>
</head>
<body>
<div>
<pre> \(╪)(╪) /</pre>
<ul>
<li></li>
<li></li>
</ul>
</div>
</body>
</html>

Output

This gives the following output −

Element Type Selector in CSS

Example

<!DOCTYPE html>
<html>
<head>
<style>
li {
   text-align: center;
   list-style: none;
   margin: 5px;
   padding: 5px;
   box-shadow: inset 0 0 15px yellowgreen;
}
div {
   box-shadow: inset 0 0 8px orange;
   padding: 36px;
   width: 30%;
   border-radius: 50%;
}
</style>
</head>
<body>
<div>
<ul>
<li>Hello</li>
<li>Guys</li>
</ul>
</div>
</body>
</html>

Output

This gives the following output −

Element Type Selector in CSS