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

DIV with browser default colors?

P: n/a
Hi,
maybe you guys know something I don't know...

Is it possible (and how) to achieve the following:

1) A <BODY> with specific background-color, say blue.

2) A <DIV class='main'> (which contains the main content text of the page)
with no colors assigned at all.

The idea is that the 'main' class would be presented to the reader with the
browser's default color sheme. This is usually black on white but could be
anything. I'd like to grant the reader the freedom to select their own
colors for the content of the page, so I don't want to set it to
black/white explicitly in my style sheet. I would still like to play a
little with colors on the rest of the page, i.e. menus, title bar, footer,
space between these elements.

Problem is: If I don't set colors for the 'main' class, the background-
color of body shines through or is inherited.

Any ideas?
Marc
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Marc wrote:
Hi,
maybe you guys know something I don't know...

Is it possible (and how) to achieve the following:

1) A <BODY> with specific background-color, say blue.

2) A <DIV class='main'> (which contains the main content text of the page)
with no colors assigned at all.

The idea is that the 'main' class would be presented to the reader with the
browser's default color sheme. This is usually black on white but could be
anything. I'd like to grant the reader the freedom to select their own
colors for the content of the page, so I don't want to set it to
black/white explicitly in my style sheet. I would still like to play a
little with colors on the rest of the page, i.e. menus, title bar, footer,
space between these elements.

Problem is: If I don't set colors for the 'main' class, the background-
color of body shines through or is inherited.

Any ideas?


18.2 User preferences for colors
<URL:http://www.w3.org/TR/REC-CSS2/ui.html#system-colors>

--
Steve

Freedom is the right to be wrong, not the right to do wrong.
-John G. Diefenbaker
Jul 20 '05 #2

P: n/a
Jim Dabell <ji********@jimdabell.com> wrote in news:p-
mc******************@giganews.com:
Marc wrote:

[snip]
The idea is that the 'main' class would be presented to the reader with
the browser's default color sheme. This is usually black on white but
could be anything.

[snip]

Browser support varies, but check out "user preferences for colors":

<URL:http://www.w3.org/TR/REC-CSS2/ui.html#system-colors>

There's nothing that specifically talks about browser defaults, but you
might want to experiment with the 'window' and 'windowtext' colours.


Thanks for your answer, Jim.

I have already heard of the system colors thing. Haven't tried it yet. Has
anybody? How is it supported by current browsers?

However, it doesn't do what I want exactly: Have a DIV with the browser
default colors on a colored body.

Any other suggestions?
Jul 20 '05 #3

P: n/a
"Steve Fulton" <ce********@hotmail.com> wrote in
news:Xr*******************@news20.bellglobal.com:
Marc wrote:

The idea is that the 'main' class would be presented to the reader
with the browser's default color sheme. This is usually black on
white but could be anything. I'd like to grant the reader the freedom
to select their own colors for the content of the page, so I don't
want to set it to black/white explicitly in my style sheet. I would
still like to play a little with colors on the rest of the page, i.e.
menus, title bar, footer, space between these elements.


18.2 User preferences for colors
<URL:http://www.w3.org/TR/REC-CSS2/ui.html#system-colors>


Thanks, Steve.

The system colors, however, seem to be the colors set by the user for the
GUI environment, i.e. windows or kde or whatever. I would like to use the
default rendering colors which are set for the browser. They can actually
be different from the system colors.

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.