Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > ASP and ASP.NET
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 03-24-2009, 03:54 PM
  #1
prog.enthusiast
Novice (Level 1)
 
Join Date: Mar 2009
Posts: 3
iTrader: (0)
prog.enthusiast is an unknown quantity at this point
modifying span class style

Hi everyone,
I was just wondering if it was possible to modify an element from the style tag for example:

HTML Code:
<style>
.homepage {  font-family: Arial, Helvetica, sans-serif; font-size: 50px; color: #ffffff;}
</style>

<span class="homepage">onomotopeia</span>
I was wondering if something like this was possible:

HTML Code:
<% bcolor = "#0000ff" %> <!-- ASP code -->
<style>
.homepage {  font-family: Arial, Helvetica, sans-serif; font-size: 50px; color: #ffffff;}
</style>

<span class="homepage.color=<%=bcolor%>">onomotopeia</span>
So, what I'm trying to do is have the variable called "bcolor" access the color attribute of the .homepage. I know I could have easily changed the color in the style from #ffffff to #0000ff but I want to be more dynamic, does anyone have any suggestions?

Last edited by prog.enthusiast : 03-24-2009 at 03:57 PM.
prog.enthusiast is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-24-2009, 04:03 PM
  #2
prog.enthusiast
Novice (Level 1)
 
Join Date: Mar 2009
Posts: 3
iTrader: (0)
prog.enthusiast is an unknown quantity at this point
fixed

Ok I found the solution

just put:

HTML Code:
<% bcolor = "#0000ff" %> <!-- ASP code -->
<style>
.homepage {  font-family: Arial, Helvetica, sans-serif; font-size: 50px; color: <%=bcolor%>;}
</style>

<span class="homepage">onomotopeia</span>
prog.enthusiast is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-10-2009, 10:12 AM
  #3
JosephJames
Fighter (Level 4)
 
Join Date: Aug 2009
Posts: 37
iTrader: (0)
JosephJames is an unknown quantity at this point
IMO it is good to create two class and change the classes dynamically.
JosephJames is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 01:17 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.