We are building a cms that allows multiple menu items and multiple subnavigation items. Within the subnavigation, we have one image per LI or the UL. The problem is that our CSS is HARDCODED. You can see this on www.summerfest.com, within our subnavigation.
The image file is ONE sprite file.
The problem is that we cannot dynamically generate the css to match.
So, we generate an ID like this, <li class="page_item page-item-172"><a href="http://www.summerfest.com/shop/psp/"><div></div><span>Premier Seat Program</span></a></li>.
There is no ID in that, there is a class and that is how classes work. If you used better clased than 172, it would make more sense when you are developing.
There is no ID in that, there is a class and that is how classes work. If you used better clased than 172, it would make more sense when you are developing.
Xequence
Contributor
4516 Points
1575 Posts
dynamically generating css
Feb 16, 2012 07:53 PM|LINK
We are building a cms that allows multiple menu items and multiple subnavigation items. Within the subnavigation, we have one image per LI or the UL. The problem is that our CSS is HARDCODED. You can see this on www.summerfest.com, within our subnavigation.
The image file is ONE sprite file.
The problem is that we cannot dynamically generate the css to match.
Here is the css.
/* psp */
#subNav .page-item-172 div { background-position : -459px 0px; }
#subNav .page-item-172 a:hover div { background-position : -459px -22px; }
#subNav .page-item-172.current_page_item div,
#subNav .page-item-172.current_page_item a:hover div { background-position : -459px -44px; }
So, we generate an ID like this, <li class="page_item page-item-172"><a href="http://www.summerfest.com/shop/psp/"><div></div><span>Premier Seat Program</span></a></li>.
But, we do not want to hardcode each item in css.
Help!
Credentials
Allen Li - M...
Star
10411 Points
1196 Posts
Re: dynamically generating css
Feb 18, 2012 08:08 AM|LINK
Hi, please refer to my reply to the following thread:
http://forums.asp.net/t/1765929.aspx
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
A1ien51
All-Star
29935 Points
5821 Posts
Re: dynamically generating css
Feb 18, 2012 11:44 AM|LINK
There is no ID in that, there is a class and that is how classes work. If you used better clased than 172, it would make more sense when you are developing.
Eric
Smith Peter
Member
142 Points
52 Posts
Re: dynamically generating css
Feb 24, 2012 05:38 AM|LINK
HI,
YOu can't acive for the CSS.
But you can generate items of aspx page from code behind dynamically.
Xequence
Contributor
4516 Points
1575 Posts
Re: dynamically generating css
Feb 24, 2012 01:21 PM|LINK
Could you please elaborate?
Credentials