Good Day: Appreciate if someone may reply the different of the below, specifically on the # (hatch symbol) in CSS coding: p#div #div p Many thanks in advance for your response.
The first means an element has an 'id' of div and is a child of <p>. The second means there is an element with an 'id' of 'div' with a <p> child. iow, the first might look like this: <p>Hello<span id="div">There!</span></p> And the second might be: <li id="div"><p>Hello There!</p></div> But I'd bet that's not what you were expecting.
Oops, Doc. There's no space in the first example. p#div refers to a p named 'div': <p id="div">Hello, world.</p>. And, it's still not what he was expecting. cheers, gary
Good Day Gurus: Many thanks for the very prompt reply, it is truly appreciated. Thanks for making the explanation so simple yet informative. Yes, the question is as simple as you think, no trick! BRAVO!