Style sheet - two textboxes - different styles

C

Chris

Hi

I have another style sheet question:

We effectively have a page that has two text boxes on it.
We would like one text box to be in one style and the other text box to be
in another style.
The problem is we would like the user to be able to control the styles using
style sheets.
Is there anyway around this without hard coding the styles into the page?

Thanks in advance

Chris
 
E

Eliyahu Goldin

Do you mean a user who has access to the server hosting your application?
Then you can use an external stylesheet, assign classes to the textboxes and
define css rules in the external stylesheet for these classes.

If you mean a client-side user, you can provide special gui and write
javascripts for setting styles and keep the styles in cookies. A big job.

Eliyahu
 
G

Guest

Chris, here's one way I've done it: have a single external style sheet which
holds your defaults, then override per page as necessary with per-user values
from your database. Because styles "cascade," if there's something
page-specific it will take precedence over the external sheet. To override
per page, easiest is to add a literal control between <head></head>, then add
your <style></style> to it at run-time. If all your pages inherit from a
single page, you only have to do this once, else you have to do it for each
page where you want the new styles.

hth,

Bill

P.S. You can also add id= and runat= to the <head> tag directly, but as has
been documented out here a bunch of times the runat= disappears at random
when you toggle to/from design mode.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top