Home
HTML
HTML CSS
Example 1: HTML CSS
Run ❯❯
<!DOCTYPE html> <html> <head> <title>CSS Cascading Example</title> </head> <body style="color:red;"> <h1>Heading Color is Inherited From Body</h1> <p>The font color of the paragrah is set to red. Though we have not given specific style to p tag. It is inheriting style from the body tag.</p> <p style="color:blue;">The font color of this paragraph is not red. Its color is blue because it has own styles that override the inherited ones.</p> </body> </html>