By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,215 Members | 1,934 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,215 IT Pros & Developers. It's quick & easy.

Style sheet - two textboxes - different styles

P: n/a
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


Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

"Chris" <cw@community.nospam> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #2

P: n/a
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.

"Chris" wrote:
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


Nov 18 '05 #3

P: n/a
Thanks for the help guys.

I did Eliyahu's suggestion in the end.

Chris

"Chris" <cw@community.nospam> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.