Page 1 of 1

How to add ID=... to the BODY tag? [SOLVED]

Posted: Thu 29. Jul 2004, 14:24
by shpolbder
I'd like to know: is there any way to add to BODY tag something like this:

Code: Select all

<body id="{pagename}">
It would be very useful for adding "this page" station in menu.
Thanks in advance.

Posted: Thu 29. Jul 2004, 15:13
by Pappnase
hello

for what did you need thsi!? did not understand for what this is good for? :oops:

Posted: Thu 29. Jul 2004, 15:48
by shpolbder
CSS

Code: Select all

body#page1 div#mainMenu li a#menuItemForPage1,
body#page2 div#mainMenu li a#menuItemForPage2,
..... {
.....
}
HTML

Code: Select all

<body id="page1">
<div id="mainMenu">
<ul>
<li><a id="menuItemForPage1" href="page1.shtml">menu1</a></li>
<li><a id="menuItemForPage2" href="page2.shtml">menu2</a></li>
...
</ul>
</div>
...

Posted: Thu 29. Jul 2004, 16:25
by shpolbder
Even Better:

CSS

Code: Select all

body.page1 div#mainMenu li a#page1,
body.page2 div#mainMenu li a#page2,
..... {
.....
}
HTML

Code: Select all

<body class="page1">
<div id="mainMenu">
<ul>
<li><a id="page1" href="page1.shtml">menu1</a></li>
<li><a id="page2" href="page2.shtml">menu2</a></li>
...
</ul>
</div>
...

Posted: Sun 1. Aug 2004, 15:58
by shpolbder
I made it another way.
Nevertheless it would be an useful option...