Current page ID/Class in body tag

markywatts

Brilliant thanks! works like a dream.
Cheers
Marky

Stefek

#4
Of course, Bernd - you're right.

You have to use a prefix beforehand.
It's because CSS won't allow numbers at the beginning of the class/id.

Regards,
Stefek


[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

BerndJM

Sorry Stefek,
but numeric id's are not allowed.
Specially the IE may show some strange behavior if a id starts with a number.
So
<body id="p<?php echo $page_id?>">
would be the better way.

Regards Bernd
In theory, there is no difference between theory and practice. But, in practice, there is.

Stefek

Hello,

use:

<body id="<?php echo $page_id; ?>">

Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

markywatts

Hi,

I need to set an ID or Class in the say the body tag, that identifies what page you are on.  So I can then apply some css thats specific to that page.  What code do I add to the template?

Thanks
Marky