WebsiteBaker Community Forum
WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: markywatts on June 19, 2009, 11:48:41 AM
-
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
-
Hello,
use:
<body id="<?php echo $page_id; ?>">
Regards,
Stefek
-
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
-
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
-
Brilliant thanks! works like a dream.
Cheers
Marky