To give same effect for different element which selector is used?
Answers
Answered by
2
Answer:
Mark me as the brainliest
Explanation:
So you can either use -
• Element Selector -
tag name - p, h1 , body , a , ul , etc.
or
• class selector -
using attribute class like <h1 class=' Any Name '> Hi </hi>
and we can give same class to many Elements and can style them
like
.class name {
css
}
full example -
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
/*class selector */
.hi{
color:white;
}
/*element selector */
p{
color:red;
}
</style>
</head>
<body>
<h1 class="h1" >Hi</h1>
<p>Hi this is paragraph</p>
</body>
</html>
Similar questions