CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 4th, 2004, 10:05 PM
dirtyirishhooer dirtyirishhooer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 13 dirtyirishhooer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 6 sec
Reputation Power: 0
CSS & Variables

I'm doing a site, but I'm trying to make it as modular as possible, so that when someone buys it I can change everything on the site in a very short time. I'm using CSS because its fantastic, and it makes my life a lot easier. My question is:

Can I define a variable in the HTML of a site and have the CSS objects on the page behave differently as a result. For example:

If I put in the variable, say:

<%pagecolour%="FF0000">

Can I then have the CSS in my style.css sheet say something like:
Code:
a:visited{
	color: %pagecolour%;
	text-decoration: none;
	border-bottom: 1px dotted #6699CC;
}

and have it fill in the colour on-the-fly.

It would mean that I can change the colours of the colour coded parts of the site (the text, table borders, etc.) in one easy step, and that'd be fantastic!

Thanks in advance for any help.

Reply With Quote
  #2  
Old January 5th, 2004, 01:55 AM
terminal's Avatar
terminal terminal is offline
nx
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: USA
Posts: 626 terminal Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 5 h 28 m 37 sec
Reputation Power: 0
Send a message via AIM to terminal
umm...if you have access to server-side languages maybe..

Reply With Quote
  #3  
Old January 5th, 2004, 08:49 AM
pixeline's Avatar
pixeline pixeline is offline
King of RGB
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: brussels
Posts: 365 pixeline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 23 h 35 m 18 sec
Reputation Power: 5
mmmmmmh... a ruin for webdesigners and for surprising websites. but the question itself is challenging...
as such, no, you cannot. But you could create an executable file (a software, really) "template generator" that would ask you to fill in all the values for the variables like the "pagecolour" one, and then generate the pages and the CSS stylesheets on the fly on your desktop. This system, correlated to a database, containing the content.
and then upload the template where you want.

but really, dreamweaver MX is a good tool for those wanting to use templates and dynamic content.
__________________
http://www.pixeline.be
........................................

Reply With Quote
  #4  
Old January 7th, 2004, 09:49 AM
tenaka tenaka is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 112 tenaka User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I don't know if this helps you but somewhere on thsi forum I read about how to make different stylesheets for a website so you copy the stylesheet blue.css rename it to green.css and the only thing you change inside is the main color from blue to green. Then you only have to find a way to let the visitor choose which css file to use.

I know there are ways to do that, but seems like it is very browser dependant. just search dev shed I know I read it somewhere here.

Reply With Quote
  #5  
Old January 9th, 2004, 08:50 PM
terminal's Avatar
terminal terminal is offline
nx
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: USA
Posts: 626 terminal Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 5 h 28 m 37 sec
Reputation Power: 0
Send a message via AIM to terminal
theres also a very complex way to do it using javascript that i use on my sites and all you do is just give color values to your variables, add the actual css code generation functions below, and then youre done.
if ya want it, i can have it for ya

[[[terminal]]]

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS & Variables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT