Important Notice:

Course Content
Float Property
0/1
Z-Index
0/1
CSS object-fit Property
0/1
CSS Visibility Property
0/1
CSS (Chapter 4) M2-R5.1
About Lesson

Child Selector

                Child selector ऐसे elements को select करने के लिए प्रयोग किया जाता है जो किसी parent element के immediate child होते है। Immediate child से यँहा पर तात्पर्य ऐसे element से है जो उस parent element के अंदर define किये गए है लेकिन किसी दूसरे parent element के अंदर नहीं है।

Child Selector

                Child selector is used to select elements which are immediate children of a parent element. Immediate child here means an element which is defined inside that parent element but is not inside any other parent element.

Example:

 

 

<html>

<head>

<style>

#myDiv > span

{   

background:pink;

}

</style>

</head>

<body>

<div id=”myDiv”>

<span>span text</span>

<span>span text</span>

<p><span>this is also span text but not immediate</span></p>

<span>span text</span>

</div>

</body>

</html>

 

error: Content is protected !!