Add element ID to body tag based on page name
Posted: Thu May 14, 2009 2:49 pm
I can't use a global mainPanel css style because I need to override it on the home page alone. See this post: viewtopic.php?f=44&t=10899.
This would be trivial to do if each page had a unique <body> id that could be used as an id selector in the stylesheet. For example, it default.aspx rendered as
then you could easily add the following to your stylesheet:
I think this could be very useful.
This would be trivial to do if each page had a unique <body> id that could be used as an id selector in the stylesheet. For example, it default.aspx rendered as
Code: Select all
<body id="acBody_Default onload="initAjaxProgress();">
Code: Select all
#mainPanel {background-color: blue;} /* default background color */
#acBody_Default #mainPanel {background-color: red;} /* for home page only */
#acBody_ContactUs #mainPanel {background-color: yellow;} /* for another special page */