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

:only-of-type

      यह pseudo class ऐसे element को target करती है जो अपने parent element का एक मात्र किसी particular type का child element होता है।

:only-of-type

      This pseudo class targets an element that is the only child element of a particular type of its parent element.

Example:

 

<html>

<head>

<style>

p:only-of-type

{   

background-color:green;

}

</style>

</head>

<body>

<div>

<p>Only Paragraph Element of Div.</p>

<span>Only Paragraph of Div.</span>

</div>

</body>

</html>

error: Content is protected !!