Scanner class Methods in Java

Style Cascade and Inheritance

Style Cascade

The Final appearance of the web page is a result of different styling rules. 

The three main sources of style information that form a Cascade are:

  • The style sheet created by the author of the page.
  • The browser's default style.
  • Style specified by the user[optional].

Inheritance

Inheritance refers to the way properties flow through the page. A child element will usually take on the characteristics of the parent elements unless otherwise defined.

Inheritance  means adopting the properties of parents or root elements by the child elements. For example,

The Code:

<html>
<head>
<style>
body{
    color:green;
font-family:Arial;
}
</style>
</head>
<body>
<p>
This is a text inside the paragraph.
</p>
</body>
</html>

Result:

CSS example
Since the paragraph tag(child element) is inside the body tag(parent element). It takes on the styles assigned to the body tag.


Comments