I have a question regarding child element inheriting parent element’s properties.
I tried doing several experiments with elements and what I found out is that if I set the font-family for parent element, it will affect the child elements inside it as well. However this doesn’t seem to be working on color as in if I want to choose specific color for child element, it won’t work if I set it for parent elment.
So let’s say that I have
nav{
float:right;
font-family:arial;
color:white;
}
nav a{
display:inline-block;
padding:2px;
background-color:black;
border:5px brown solid;
text-decoration:none;
border-radius:5px;
}
the color white will not be applied to child element “a” because I set it for parent element, but for font-family, it doesn’t seem to matter.
Is there a way to find out what other properties have these types of functions or do I just memorize whatever works?
=================
question #2:
if I put html{
color:white;
}
instead of nav a, only the title “Welcome!” gets only white, why?