I've been reading about CSS and I am really confused about how the inheritance works (I think thats the right term for the following). In CSS I can declare a class:
#mytext {
}
then I see some people do:
p.mytext {
}
But why do that? Why can't they just do:
<p class="mytext">
Without declaring p.mytext
? Does it make sense what I am asking?
and sometimes i see:
p#mytext
... Why is it different? I'll keep searching tutorials but thanks for any advise.