Css. Inheritance

styles are inherited. for ex. <p> inside <body> inherits styles of <body>

body { font-family: Arial, Helvetica, sans-serif; } // this will be inherited for all tags inside

not all sttributes are inherited, borders are not for ex.

.myClass {
  color: red


<body class = "myClass">
<p></p>  <!-- p will also have red color -->
</ body>

more concrete element more important

This entry was posted in Без рубрики. Bookmark the permalink.