Because those elements are not the first child element in their respective containers.
On 6 Mar 2011, at 10:03, tee wrote: > http://jsbin.com/apate4/9/ > > dt, dd { border-top:1px solid #555;float:left } > dt:first-child {border-top:0} > dd:first-child {border-top:0} <!-- Container --> <dl> <!-- 1st Child --> <dt>test</dt> <!-- 2nd Child --> <dd>There should be no border top here</dd> Since the <dd> is not the first child, a selector using :first-child won't apply. > h2, p {background:#ddd;padding:15px;margin:5px} > h2:first-child,p:first-child {background:#95B26B} p/s. I tried declared the > two individually as I thought maybe they can't be grouped, but it makes no > differences. <!-- Container --> <body> <!-- 1st Child --> <dl> ... </dl> <!-- 2nd Child --> <h2>Heading 2 this is the first-child and the bg color should be in Olive.</h2> Ditto. -- David Dorward http://dorward.me.uk ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [email protected] *******************************************************************
