Child vs direct child : Level Selector « Style Basics « HTML / CSS

HTML / CSS » Style Basics » Level Selector 
Child vs direct child
  

<html>
 <head>
  <title></title>
<style type="text/css">
p > strong {
  text-decoration: underline;

</style>
<body>
<div>
 <p>Nothing happens to this part of the sentence because this 
<strong>strong</strong> isn't the direct child of div.</p> 
 However, this <strong>strong</strong> is the child of div. 
Therefore, it receives the style dictated in the CSS rule.
</div>
<body>

   
    
  
Related examples in the same category
1.Set style for paragraph in a blockquote
2.LI under UL which are in a DIV
3.Three level nested for tag names
4.Set anchor in LI under UL which are in a DIV
5.tag name.class name
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.