Faculty of Engineering and Mathematical Sciences 
Not logged in (login)


This forum is provided to promote discussion amongst students enrolled in Agile Web Development (CITS3403).
RSS cloud
Jump to:

CSS inherit

1 of 419 articles shown, currently no other people reading this forum.
From: Haolin W.
Date: Sun 15th Mar 2020, 5:26pm


Hey. Yes you're correct. The inherit property applies the property from the immediate 
parent. As for your other question, I'm not exactly sure what you mean. Do you mean 
inheriting from grandparent/great-grandparent elements? If that's the case, CSS already 
does that.

Take this example. https://puu.sh/FkN8V.png
This has a text colour of red applied on the grand parent element. However, all following 
elements will inherit the red text unless specified otherwise. https://puu.sh/FkNaB.png

The standard inherit example is best visualised when you try to use anchor tags (<a>) to 
redirect to other areas, where the link will always have the blue hyperlink colour. Using 
inheritance removes that colour.

Related articles

CSS inherit (both) RSS
├─ original 💡 Sun 15th Mar 2020, 1:12pm, ANONYMOUS
└─ THIS   Sun 15th Mar 2020, 5:26pm, Haolin W.
This Page

Program written by: [email protected]
Feedback welcome
Last modified: 11:27am Sep 21 2020