I'm a 32-year-old webdeveloper living in Wateringen, working in Rotterdam, The Netherlands.
This is my personal weblog.
Sometimes I make art with code.
I like to make lots of photos, of which I post my faves here.
Mail me at milovermeulen at gmail dot com!
View all photos, or filter by faves, art, concerts, trips, animals, black-and-white, street shots, squares, more...
<ul>elements as a flat comma-separated list(now in effect in the main menu and links list in the left-hand column):ul.links { list-style: none; margin: 0; padding: 0; } ul.links li { display: inline; } ul.links li:after { content: ","; } ul.links li:last-child:after { content: ""; }The advantage of this is that changing the default separator from a comma to
|or-or whatever now means only having to change one character in the stylesheet.Note: Internet Explorer doesn't support the css
contentattribute or:afterand:last-childpseudo-classes, so the commas won't appear in IE.tags:- this site
- css
- coding
posted Wednesday, January 12, 2005comments
1. posted by Low at 23:06 on January 12, 2005
ul.links li:after { content: ","; }
ul.links li:last-child:after { content: ""; }
Now the commas aren't part of the hyperlink, which I prefer. :)
2. posted by Milo at 23:09 on January 12, 2005
I've updated the code sample (and my stylesheet).
3. posted by Low at 23:16 on January 12, 2005
ul.links li:last-child:after { content: "."; }
...because of all the commas. I think it looks better with a full-stop at the end. But hey, that's just me.
4. posted by Anne at 08:02 on January 13, 2005
5. posted by Milo at 09:02 on January 13, 2005
6. posted by Milo at 11:17 on January 13, 2005
7. posted by Arve at 12:07 on January 13, 2005
ul.links li:first-child:before { content: ""; }
ul.links li:last-child::before { content: " and "; }
Example output:
One, two, three and four
8. posted by Milo at 12:15 on January 13, 2005
One ,two ,three and four
which is not quite the same.
9. posted by Frenzie at 13:13 on January 13, 2005
One ,two
but as
One,two
which would be easy to solve by
content: ", "
10. posted by Milo at 13:58 on January 13, 2005
11. posted by Low at 14:04 on January 13, 2005
I was gonna say that; you beat me to it. Anyway, if you _would_ remove the whitespace or if the css3 rule would work, my vote would go out to:
ul.links li:before { content: ", "; }
ul.links li:first-child { text-transform: capitalize; }
ul.links li:first-child:before { content: ""; }
ul.links li:last-child:before { content: " and last but not least: "; }
ul.links li:last-child:after { content: "."; }
I was going for something like "ul.links li:first-child:first-letter { text-transform: uppercase; }", but that didn't work.
:)
12. posted by Milo at 14:12 on January 13, 2005
ul.links li:first-child a:first-letter { text-transform: uppercase; }
*would* work, but it also doesn't.
13. posted by Low at 14:40 on January 13, 2005
14. posted by Mathieu 'P01' HENRI at 14:53 on January 13, 2005
works ;)
15. posted by Anne at 15:22 on January 15, 2005
Re #6, I'll post an example later if I can get it to work.
16. posted by Milo at 15:40 on January 15, 2005
Your favicon is black-on-transparent, and too large (32x32) to be visible as a background-image in your name-link, meaning it won't even show now that I've fixed the detection! :)
« FonzTeeVee - Murals for ROC AMSTERDAM | Main | Logitech F-Lock Key Eliminator »