CSS “TOC” style?
I’m just curious… is there a fancy way to do something like this in CSS:
Introduction …………… Page 1
Information ……………. Page 2
More Info ……………… Page 3
… where the “Page” text lines up and the “…..” just fills in until it reaches the “Page” text… kind of like you’d see in a table of contents in a book? (Ideally the “….” wouldn’t even be text in the markup. It would just be a background fill or something…) Is that even possible?
Update: Jenna got me on the right track…. (Thank you!)
Make each line part of a list item. Apply the background image to <li> style. Wrap each part with another tag. Float one right, the other left, and give them both a solid color background the same as the rest of the page (so that it covers the dot, so it won’t show through under the text). I also wanted the right column to line up, so I gave it a width, and told the text to align-left. Here’s the example.
March 9th, 2007 at 8:22 pm
I’m almost CERTAIN that I’ve seen that in a WordPress Theme recently.
March 9th, 2007 at 8:23 pm
Sure enough!
WordPress Foliage Mod
http://5thirtyone.com/foliagemod/
I was impressed when I saw it.
March 10th, 2007 at 3:55 pm
Yup. The Foliage Mod had a table of contents type navigation block in the header. Funny, I was just about to post the tutorial / code for that on my site. It’s going up tomorrow.
March 15th, 2007 at 12:41 am
Wow, thanks! I love CSS!
March 9th, 2008 at 3:46 pm
Thank you for posting a simple example. Most of the examples that I find are not shown on a page by themself, which I LOVE by the way. It is so much easier to grasp when on a standalone page like that.