Home
CSS
CSS Color Keywords
Tryit: Using the inherit keyword
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> div { border: 2px solid red; } span { border: inherit; } </style> </head> <body> <h2>The inherit Keyword</h2> <div>Here, the <span>span element's</span> border settings will be inherited from the parent element.</div> <br> <div style="border:2px dotted blue;">Here, the <span>span element's</span> border settings will also be inherited from the parent element.</div> </body> </html>