I need some help coding individual elements in CSS. If I wanted to have my first HR line to have no top margin and my second HR to have a top margin of 15px, how would I code that? Thank you.
@NogDogJul 21.2005 — #I'll grant you that, but what if there's a <p>...</p> before the first <hr>, so that the <p> is the first-child of the containing element? Assuming I understand it correctly (possibly an incorrect assumption), then it wouldn't work, would it?
@NogDogJul 21.2005 — #You can do the following if most HR's will look one way, a few (class) will look another way, and a specific one (ID) will look yet another way: <i> </i>. . . <style type="text/css"> hr { margin: 10px 20px; } hr.some { margin-top: 15px; } hr#one { margin-top: 0; } </style> </head> <body> <hr id="one"> <hr> <hr class="some"> <hr> <hr class="some"> <hr> . . .
@stimpy1authorJul 22.2005 — #Thanks, you've all been really helpful. I started out just doing basic html to build my first website, and now I'm incorporating css. I'm looking forward to learning more.
@proutonJul 22.2005 — #Perhaps the reason to not use the child and sibling pseudo-class selectors is that [i]IE doesn't support them[/i]. I'm not a fan of using IE, but given the installed base you can't ignore its limitations.