want to know if we apply bold style to body tag then all the elements in the body tag gets that property but this doesn’t happen if we apply the padding or margin.
Body tag working knowledge
@Raman-Chopra-2035434769848308 it is all related to inheritance, give a read to this article, may help you with your query
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
still I am not able to get it want to know if we apply bold style to body tag then all the elements in the body tag gets that property but this doesn’t happen if we apply the padding or margin.
@Raman-Chopra-2035434769848308 have you read the article which I have shared, it’s good to be curious but instead of looking for a to the point solution, you should look for in depth knowledge.
To the point answer would be:
bold style in your body tag, is inherited (passed on) to the children of the body tag, where as the padding and margin styles are not inherited. You can force them to inherit, there are some workarounds (explained in the article).
I read the article and saw how we can force the styling to child but wanted to know why bold style in your body tag, is inherited (passed on) to the children of the body tag, where as the padding and margin styles are not inherited. Is it default css behaviour or is there any reason behind it.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.