By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,045 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

How to autonumber my blog's comments?

P: n/a
Hi,

I am rather inexperienced with CSS. I was looking around and saw that
one can auto-number, so I though that I would like to use this on my
blog's comments.

There is a template for the comments, which will be used for all, so I
just need a single CSS definition.

What I was thinking of was putting the number in a large font, as
background, either in a faint colour, or partially opaque, or similar,
so that it shows through behind the darker foreground text, but can
still be seen.

Can some CSS guru help me?

Thanks very much in advance.

Oct 3 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Scripsit Pa************@gmail.com:
I was looking around and saw that
one can auto-number,
In practice, you cannot. The CSS constructs for that are too poorly
supported. Features that aren't supported by Internet Explorer are generally
not very useful on the WWW. Of course, if it's about a _minor_
presentational enhancement, you could do things theoretically right,
accepting the fact that it won't work in the great majority of browsing
situations.
so I though that I would like to use this on my
blog's comments.
A blog with a commenting possibility is inherently an interactive system, so
you should make the _server-side_ component generate the numbering. Unless,
of course, you are satisfied with using just <ul>, and you probably aren't.
There is a template for the comments, which will be used for all, so I
just need a single CSS definition.
No, you need to change the template.
What I was thinking of was putting the number in a large font, as
background, either in a faint colour, or partially opaque, or similar,
so that it shows through behind the darker foreground text, but can
still be seen.
That would be an odd approach, and rather disturbing. The template should be
something like the following (if you want to have the comments numbered,
which might be a good idea for referencing purposes):

<h2 id="c{number}">{Heading of the comment as written by the user}</h2>
<div>Comment {number}</div>
<div>By {name}</div>
<p>Text of the comment ...

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Oct 3 '06 #2

P: n/a
<Pa************@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Hi,

I am rather inexperienced with CSS. I was looking around and saw that
one can auto-number, so I though that I would like to use this on my
blog's comments.

There is a template for the comments, which will be used for all, so I
just need a single CSS definition.

What I was thinking of was putting the number in a large font, as
background, either in a faint colour, or partially opaque, or similar,
so that it shows through behind the darker foreground text, but can
still be seen.

Can some CSS guru help me?

Thanks very much in advance.
I've seen this done at http://www.peterjoel.com/

Taking a look at the code, they have set the style to

style="background: url(commentnum.php?n=1&col=E2E8F4&bgcol=F3F6FC) bottom
right no-repeat"

So they must use the server side scripting to insert this css (maybe your
blog template has a server side "tag" that can output the number of the
comment), and then a php script that generates the background image.

An alternative method that might be quite elegant (if it works - which it
may not) - maybe you can get the server side code to output an ordered list
of comments (rather than outputting divs ps uls or whatever), and then style
this somehow (as you already have the number, you just need to fiddle it's
positioning and colour).

Hope these get you started, but would be good to hear what your final
solution is.

ME
Oct 3 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.