|
Posted by John Hosking on October 22, 2007, 1:53 am
Please log in for more thread options
Corey Walker wrote:
>
> I like having colourful pages and was tired of the dreary black
> and white look, so I did what lots of web designers have done, and tried
> to create each paragraph with a different colour. So, how do I
> accomplish my desired effect (a multi-coloured page), so that it works
> for people with non-default background colours. There must be a way of
> making both worlds happy. At least, I hope there is.
If you want the whole page to have some non-default (or at least, some
specific) BG color, set it the way I suggested earlier, by including:
body { color:black; background-color:yellow; }
in the CSS. Or instead of yellow, use #FFFF00. Or some other RRGGBB
color combination. Just make sure when you do this that you set a
(pleasingly) contrasting color for the text.
The set the BG for specific paragraphs (or any other element), you use
the same technique:
p { color:black; background-color:#ffdddd; }
for all your paragraphs. Or add class or id names to <p> elements to
style them selectively:
p.recyclingtip { color:white; background-color:#00FF00; }
p#footer { color:#FFFFFF; background-color:#0000FF; }
with markup containing
<p class="recyclingtip">Re-use your egg cartons!</p>
<p class="recyclingtip">Coffee grounds can be composted.</p>
<p id="footer">Copyright 2007 REAPS.org</p>
For reasons of national security, I am required by law to instruct you
to avoid publishing a real page which makes "each paragraph a different
colour". By posting pages with garish colors and unreadable text flow
you become subject to arrest and, potentially, imprisonment for life in
the year 1997.
--
John
Pondering the value of the UIP: http://improve-usenet.org/
|
|
Posted by André Gillibert on October 22, 2007, 3:28 pm
Please log in for more thread options
John Hosking wrote:
> If you want the whole page to have some non-default (or at least, some
> specific) BG color, set it the way I suggested earlier, by including:
>
> body { color:black; background-color:yellow; }
>
You forgot: background-image: none;
This may be necessary if the user uses a stylesheet with a background
image.
If you specify the foreground color, background color, or backround image
(even if it's "none"), then, specify all of them. The CSS background
shorthand property helps.
This guideline applies to author and user stylesheet writing.
A particular attention must be ported to the weight of each rule. The most
obvious case is that, if you specify the foreground color as a !important
rule, the background color and image should be specified with a !important
rule.
If the user really needs a specific background and foreground, then, he'll
use !important rules.
--
If you've a question that doesn't belong to Usenet, contact me at
|
|
Posted by Stan Brown on October 22, 2007, 7:52 am
Please log in for more thread options Mon, 22 Oct 2007 05:10:42 GMT from Corey Walker
> I like having colourful pages and was tired of the dreary black and
> white look, so I did what lots of web designers have done, and
> tried to create each paragraph with a different colour.
That's good if you're Fisher Price. Otherwise it just looks (sorry,
but I can't think of a kinder word) childish.
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/ HTML 4.01 spec: http://www.w3.org/TR/html401/ validator: http://validator.w3.org/ CSS 2.1 spec: http://www.w3.org/TR/CSS21/ validator: http://jigsaw.w3.org/css-validator/ Why We Won't Help You:
http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you
|
|
Posted by Jonathan N. Little on October 21, 2007, 7:24 pm
Please log in for more thread options Jeff Gaines wrote:
>
>> BTW, two weeks ago I suggested defining a background color, but your
>> site still lacks such a definition. Something like this in the CSS:
>
> As a complete newb to HTML may I ask a question on this please?
>
> I read 'somewhere' (and I've read so much recently I can't remember
> where) that the background should not be coloured as some people have
> their PC's set up with specific colours due to visual impairment. Does
> that make any sense? I run XP and I experimented with background colours
> on the PC and found that IE7 does indeed follow the system settings.
>
No, they can override the style with a user stylesheet or turn it off in
their browser. I would say what more important is consider the contrast
of text and background.
Also if you choose a background image be sure to also define a
background color. Make it basically the same color as the image so the
text is readable while background image loads. We folk stuck on dialup
notice this all the time. Bad sites will have a page with white text on
say a blue background image. The don't define a background color so the
browser default white is displayed as the monster background image
loads...until it does we see white on white!
Another thing is not to define font size in pixels so the user may
enlarger it if they need to.
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
|
|
Posted by David E. Ross on October 22, 2007, 3:25 am
Please log in for more thread options On 10/21/2007 3:49 PM, Jeff Gaines wrote:
>
>> BTW, two weeks ago I suggested defining a background color, but your site
>> still lacks such a definition. Something like this in the CSS:
>
> As a complete newb to HTML may I ask a question on this please?
>
> I read 'somewhere' (and I've read so much recently I can't remember where)
> that the background should not be coloured as some people have their PC's
> set up with specific colours due to visual impairment. Does that make any
> sense? I run XP and I experimented with background colours on the PC and
> found that IE7 does indeed follow the system settings.
>
The general rule is that, if you set one color, you should set them all:
background, regular text, links not yet visited, links previously
visited, and links over which the cursor is hovering.
I set my background to a very pale green, which is less straining for
most eyes than white. It is close enough to white (#f0fff0 versus
#ffffff) that it has almost the same contrast as a white background for
any color text.
I don't set colors for regular text or links, violating the general
rule. The usual browser defaults are black for regular text, blue for
unvisited links, and red for visited links. These all give very good
contrast with a pale green background. I assume that those who set
other default text colors also set their background colors to obtain
sufficient contrast. (I set a yellow background for links over which
the cursor is hovering, but I don't set a color for the text of the link.)
I think one of the worst designed Web pages I ever saw had a black
background with a pattern of bright yellow and orange daisies. The text
was red. It was almost impossible to read. This was the home page of
an ISP that obviously was not interested in customers, only in
demonstrating how clever and artistic the Web master was.
--
David E. Ross
<http://www.rossde.com/>
Natural foods can be harmful: Look at all the
people who die of natural causes.
|
| Similar Threads | Posted | | Problem with upgrading my site | May 7, 2005, 9:28 pm |
| Can well-formed but non-validated XHTML have extra namespaces? | November 20, 2006, 10:54 am |
| Recommendations for good Web site hosting company (for personal Web site) | April 16, 2006, 7:49 pm |
| Need help with my site - search function within my site not working?!? | April 24, 2008, 8:52 pm |
| What is this site using | January 4, 2005, 7:48 pm |
| How to add RSS 2.0 to my web site? | August 22, 2005, 6:01 pm |
| Subscription Web Site | August 28, 2004, 9:36 am |
| Site Migration | January 5, 2005, 5:59 am |
| Site critique | February 3, 2005, 5:00 pm |
| Help with web site management | February 11, 2005, 6:26 am |
|