+ 1

Can someone please give an example of how "inherit" is used in font variant?

23rd May 2017, 9:45 AM
Jane Wong
Jane Wong - avatar
2 Answers
+ 5
if you study the code below on how the output color is green you will understand better <html> <head> <style> body { color: blue; font-family: Arial; } p{ color: green; } </style> </head> <body> <p> This is a text inside the paragraph. </p> </body> </html>
28th Feb 2018, 7:35 PM
Ayodele Abigail Oluwabunmi
Ayodele Abigail Oluwabunmi - avatar
+ 2
Say you have a <ul> and the <li> tags inside had font-variant: small-caps; and inside those <li> you have a <p> and that paragraph tag has font-variant: inherit, it will inherit whatever the font-variant of its parent is, in this case the <p>'s parent is <li>, so it will inherit small-caps.
24th May 2017, 3:09 PM
Tyler Sutton
Tyler Sutton - avatar