inherit keyword : inherit « Style Basics « HTML / CSS






inherit keyword

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title> Property Inheritance </title>
        <style type='text/css'>
          div#parentdiv {
          border: thin solid black;
      }
      div#childdiv {
          border: inherit;
      }
        </style>
    </head>
    <body>
    <div id='parentdiv'>
         This div has a border around it.
        <div id='childdiv'>
            This div also has a border around it.
        </div>
    </div>
    </body>
</html>

 








Related examples in the same category