CSS
Please explain the deference between class selector and id selector in CSS
By : nelka Email : nelka@tekstart.lk
Date/time : 2018-05-27

ID 1
Name Menaka
Email menaka@tekstart.lk
Answer a class selector is a name preceded by a full stop (“.”) and an ID selector is a name preceded by a hash character (“#”).
A given element can have more than one class associated with it, while an element can only have one id
Date/Time 2018-05-27

ID 2
Name Menaka
Email menaka@tekstart.lk
Answer <style>
#st1{
background: #FFFF00;
border: 1px solid #0000FF;
color: #FF00FF;
}
</style>
<div id="st1">
Welcome
</div>
Date/Time 2018-05-27

ID 3
Name Menaka
Email menaka@tekstart.lk
Answer .st1{
background: #FFFF00;
border: 1px solid #0000FF;
color: #FF00FF;
}
.st2{
text-decoration:underline;
}
</style>


<div class="st1 st2" >
Welcome
</div>

Date/Time 2018-05-27

Name
Email
Answer
User Code