Add CSS styling to output, span inside a paragraph - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:element parent child

Description

Add CSS styling to output, span inside a paragraph

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <style type="text/css">
.postedon {<!--from w  w w. j  a  va 2 s  .  c o  m-->
   color:black;
}
.postedon span {
   color: red;
}

      </style> 
   </head> 
   <body> 
      <p class="postedon">
          Posted on 
         <span>11/09/1987 14:00:00</span> 
      </p>  
   </body>
</html>

Related Tutorials