Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to allow site visitor to select own background image/color

Status
Not open for further replies.

sailingfree

Programmer
Sep 13, 2006
32
GB
Anyone know how you allow a site visitor to select their own background color or image for their entire visitor session?
 
You would create multiple stylesheets with different color combinations (and background images) and provide the selection somewhere on the screen. On clicking, you would switch up the stylesheets and write the information on which stylesheet the user wants in a cookie. The latter, being the core operations within this script, cannot be done via html, so you will need to resort to either:

a) client side scripting, like javascript (forum216) or
b) server side scripting, like php, asp, coldfusion, perl -- whatever you have available.

You should ask your question in those forums then.
 
I don't like the multiple stylesheet method for a variety of reasons, the main one being that unless you want to code a gazillion different stylesheets, one for every color combination the user can select, you will severely limit your users' choices. I'd much rather simply save the color VALUES, and plug them into the generated HTML in style attributes, or even plug them into an in-line stylesheet.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top