467,158 Members | 946 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,158 developers. It's quick & easy.

Style sheet - two textboxes - different styles

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
  • viewed: 1604
Share:
3 Replies
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
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
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.

Similar topics

6 posts views Thread by Mark Cunningham | last post: by
2 posts views Thread by Markus Ernst | last post: by
5 posts views Thread by BenOne© | last post: by
4 posts views Thread by Wintersrush | last post: by
2 posts views Thread by Matthew McDermott | last post: by
5 posts views Thread by David C | last post: by
2 posts views Thread by Hallvard B Furuseth | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.