---
title: "Inheritance in CSS"  
description: "Inheritance in CSS"  
author: "Hank Greenberg"  
published: 2013-06-14  
updated: 2013-06-15  
canonical: https://www.mindstick.com/forum/1099/inheritance-in-css  
category: "css-css3"  
tags: ["css-css3"]  
reading_time: 1 minute  

---

# Inheritance in CSS

Hi [Developers](https://www.mindstick.com/articles/12875/blunders-you-must-avoid-while-hiring-java-developers-to-get-the-best-fulfilling-your-needs),\
What is meaning of [inheritance](https://www.mindstick.com/articles/13095/inheritance-and-its-types) in [CSS](https://www.mindstick.com/forum/514/background-gradient-ie7-css-problem) terminology? Can you provide any example for better [understanding](https://www.mindstick.com/articles/12918/cat-5e-vs-cat-6a-understanding-the-major-differences)!\
Your help is greatly appreciated.

## Replies

### Reply by AVADHESH PATEL

\
Some styles, like font family, text-alignment etc., are automatically inherited by child elements from their parent element (i.e. by an element contained inside another one).\
Others are not automatically inherited.**\****Example**

```
<div style=”font-family:serif; border:1px solid red; padding:10px;”>This text will be in a serif font. <p> This text is also in a serif font, because font is inherited by default. But the border and padding properties are not inherited from the parent div. </p></div>
```

\


---

Original Source: https://www.mindstick.com/forum/1099/inheritance-in-css

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
