What are selectors in CSS?
Selectors help to select an element to which you want to apply a style. For example below is a simple style called as ‘intro” which applies red color to background of a HTML element.
Collapse | Copy Code
<style>
.intro
{
background-color:red;
}
</style>
To apply the above “intro” style to div we can use the “class” selector as shown in the below figure.
Collapse | Copy Code
<div class="intro">
<p>My name is Shivprasad koirala.</p>
<p>I write interview questions.</p>
</div>
__________________
John Bates
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|