Post Archive
› September 8, 2003
Item next to item selection
One of the new CSS treatments added to this site is the paragraph indentation of posts, or rather the paragraph indentation of all paragraphs except the 1st ones. This is one of those nice things about CCS2 selectors that both work well, and degrade nicely. To do this, I wanted to select p tags only if they are preceded by a p tag. Adjacent Selectors do the trick here, and they are easy to use: e.g. p+p is the selector used here at Web-Graphics.
Look see, here's a second paragraph. Is it semantically correct to make a paragraph that serves no other purpose than to be self-proclamatory? Don't answer that.
Comments
1. September 8, 2003 12:59 PM
2. September 8, 2003 01:20 PM
Anne van Kesteren Posted…
Zeldman had the same issue, the top-margin of the first heading should be smaller than the margin of the rest of the page. He chose a class... More authors should make choices like this. All those little improvements for standard compliant browser will make the switch a lot easier (for those who haven't switched of course).
3. September 8, 2003 01:22 PM
Anne van Kesteren Posted…
Just one more thing: invalid , shouldn't be that hard to fix, is it?
4. September 8, 2003 01:37 PM
Nate Posted…
Hmm, I'm not sure this will fix the validation problem, testing now. Thanks for pointing it out Anne.
5. September 8, 2003 01:39 PM
Nate Posted…
I'm flabbergasted that it worked, somewhere along the line of comment preview and entry the entities get transformed into actual tags, that's quite lucky because now it validates
Jakob S Posted…
With the added bonus of IE not understanding Adjecant Selectors. Yet another (albeit tiny) reason for the IE hordes to switch...