ad

Showing posts with label CSS in combinators. Show all posts
Showing posts with label CSS in combinators. Show all posts

Saturday, November 12, 2022

CSS in combinators

 

  combinators in CSS 



1. Descendant selector  

Descendant selector (space) matches all the elements that are descendants of a specified elements, it means that selectors can select element that are descendants of others selector. The element does not have  be  direct child, but rather  descendant down the line.


Syntax:

element1 element2

{

style_properties

}


Descendant selector

 Example 

<!DOCTYPE html>

<html>

<head>

<style>

 ol li { 

color: red;

 } 

 </style>

</head>

 <body>

<ol>

<li>Databases</li> <br>

<ul>

<li>Oracle/PLSQL</li> 

<li>SQL</li>

</ul>

<li>ASP.Net</li>

<li>Java</li>

</ol> </ul>

 </body>

 </html>