473,320 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Stylesheet doesn't display proper color

I was hoping someone more expert in css could help me w. a problem I'm
having w. a stylesheet I've created for a Pbase photo site. My site
is at http://www.pbase.com/richards1052. Currently, it displays a
white background color. I've set in the stylesheet that the color
should be navy or #00080 (perhaps I didn't set this in the proper
place?). After updating the stylesheet the site displays a sample
view of my new stylesheet w. my changes. Here the background color is
correct (navy). But when I go to my actual site the color is white.

Pls. give me some idea of what I did wrong.

Richard
Jul 20 '05 #1
9 2842
Richard Silverstein <ri**********@comcast.net> wrote:
I was hoping someone more expert in css could help me w. a problem I'm
having w. a stylesheet I've created for a Pbase photo site. My site
is at http://www.pbase.com/richards1052. Currently, it displays a
white background color. I've set in the stylesheet that the color
should be navy or #00080 (perhaps I didn't set this in the proper
place?). After updating the stylesheet the site displays a sample
view of my new stylesheet w. my changes. Here the background color is
correct (navy). But when I go to my actual site the color is white.

Pls. give me some idea of what I did wrong.


The CSS validator <http://jigsaw.w3.org/css-validator/> complains about the
HTML doctype declaration and other text you put at the beginning of your
style sheet. They're breaking the selector for your first CSS ruleset,
which is where you set the navy background color.

<style type="text/css">
<!--
DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Richard Silverstein's Photo Galleries at pbase.com

Delete the doctype declaration. If you want to put a comment inside your
CSS, then use CSS-style comments: /* like this */

Also, since I was looking...

BODY
{
color: white;
background-color: navy;
font-size: 7pt;
}

You shouldn't use pt (or px) for font sizes on the web:
http://css.nu/faq/ciwas-aFAQ.html#QA02

And 7pt is absurdly small for many (most?) users. It's certainly quite a
bit smaller than the minimum font size that my browser enforces.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"Warning: Dates in the calendar are closer than they appear."
Jul 20 '05 #2
On 11 Jul 2003 17:30:45 -0700, ri**********@comcast.net (Richard
Silverstein) wrote:
I was hoping someone more expert in css could help me w. a problem I'm
having w. a stylesheet I've created for a Pbase photo site. My site
is at http://www.pbase.com/richards1052. Currently, it displays a
white background color. I've set in the stylesheet that the color
should be navy or #00080 (perhaps I didn't set this in the proper
place?). After updating the stylesheet the site displays a sample
view of my new stylesheet w. my changes. Here the background color is
correct (navy). But when I go to my actual site the color is white.

Pls. give me some idea of what I did wrong.

With IE 6 the dark background color is displayed if I put the browser
in "quirks mode" by eliminating the doctype line.
Jul 20 '05 #3
Darin: Thanks for parsing my site & css. You're dealing w. someone
who's a bit of a dolt when it comes to css. So could you help me by
telling me exactly what I should delete fr. the html doc declaration.
In other words, what should this statement look like if it was
correct?

<style type="text/css">
<!--
DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Richard Silverstein's Photo Galleries at pbase.com
As for the font size, it looks fine as it displays on my site.
Perhaps this site has some quirks that allow non standard css
formatting to look OK. But returning to yr. comment about font size
standards, if I don't use pixels or pt. what standard should I use?
And what might be the range from small (but readable) size to large
(headline type) for this font size measurement?

Richard

McGrew <mc****@stanfordalumni.org> wrote in message news:<be**********@blue.rahul.net>...
The CSS validator <http://jigsaw.w3.org/css-validator/> complains about the
HTML doctype declaration and other text you put at the beginning of your
style sheet. They're breaking the selector for your first CSS ruleset,
which is where you set the navy background color.

<style type="text/css">
<!--
DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Richard Silverstein's Photo Galleries at pbase.com

Delete the doctype declaration. If you want to put a comment inside your
CSS, then use CSS-style comments: /* like this */

Also, since I was looking...

BODY
{
color: white;
background-color: navy;
font-size: 7pt;
}

You shouldn't use pt (or px) for font sizes on the web:
http://css.nu/faq/ciwas-aFAQ.html#QA02

And 7pt is absurdly small for many (most?) users. It's certainly quite a
bit smaller than the minimum font size that my browser enforces.

Jul 20 '05 #4
Richard Silverstein wrote:
telling me exactly what I should delete fr. the html doc declaration.
In other words, what should this statement look like if it was
correct?
<!--
DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Richard Silverstein's Photo Galleries at pbase.com

the style element is part of the html page. Don't declare a separate
dtd for the style element. All that I left above can be deleted. Get
rid of the --> too.

<style type="text/css">

body {font-size: 100% }
/* etc. */

</style>

BTW, it is better to put styles in a separate stylesheet via the link
element. If you do, remember that a stylesheet is not a hypertext
markup language (html) document. Thus, there is no dtd in it.
As for the font size, it looks fine as it displays on my site.
No. It looks fine on your computer. But your computer is not my
computer. Your computer is not Joe's computer, either. Nor
Mustafah's. And it certainly isn't anyone's pda, or cell-phone....
Perhaps this site has some quirks that allow non standard css
formatting to look OK.
I assure you that is not the case. The font is tiny, smaller than
what I want to read, and thus what I set in my browser.
But returning to yr. comment about font size
standards, if I don't use pixels or pt. what standard should I use? And what might be the range from small (but readable) size to large
(headline type) for this font size measurement?


I'm going to answer these questions in reverse order.

2. Users can set a default font in their browser. Don't try to
override their wishes. Leave the font size of the body element alone.
Ditto for the p element. As it is, I need to increase the font size
with my Mozilla browser.

1. Don't use pt or px, because, while I can resize it in Mozilla, one
cannot do that using certain versions of MSIE. Use em units, or
percent. They are more or less equal. I'll explain percentage.

Leave the body alone. Or, since there are reportedly bugs in IE,
explicitly to 100%, that is, the users default (no matter which
browser they use).

body {font-size: 100%}

Set other elements to a percentage of the body element, or the default
user's setting, e.g.,

h1 {font-size: 140%}
h2 {font-size: 120%}
p.legalnotice {font-size: 90%}

Very little text should be set below 100%. Some say that *no* text
should be below 100%. I think it's ok to put a copyright notice or
other such things a bit smaller, but not too much below.

Please edit the quoted parts of your replies. And consider using
google to search for the faq, and read this newsgroup. The info about
the font size gets repeated every week in this newsgroup. It's the
second time I've answered it in last 10 minutes.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #5
William: thanks for confirming Darin's idea that the doc declaration
is the problem. So let me understand clearly what exactly needs to be
eliminated. Here's the current code:

<style type="text/css">
<!--
DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Richard Silverstein's Photo Galleries at pbase.com
Should the correct coding look something like this?

<style type="text/css">
Richard Silverstein's Photo Galleries at pbase.com

thanks, Richard

William Starr Moake <ws*****@yahoo.com> wrote in message news:<6r********************************@4ax.com>. ..
With IE 6 the dark background color is displayed if I put the browser
in "quirks mode" by eliminating the doctype line.

Jul 20 '05 #6
Brian: Believe it or not, that "<!--" was the final "straw" that made
my site display properly (blue background!)!! I don't know why that
was what was standing in the way of proper display--but you were right
about getting rid of it--& removing it fixed the problem.

Thanks so very much, Richard

Brian <br***@wfcr.org.invalid-remove-this-part> wrote in message news:<IjWPa.44840$H17.13673@sccrnsc02>...
the style element is part of the html page. Don't declare a separate
dtd for the style element. All that I left above can be deleted. Get
rid of the --> too.

Jul 20 '05 #7
Richard Silverstein wrote:
Brian: Believe it or not, that "<!--" was the final "straw" that made
my site display properly (blue background!)!!

Thanks so very much


You are quite welcome. Glad things are working. In case you plan on
responding to threads in this newsgroup in the future, please see

http://www.cs.tut.fi/~jkorpela/usenet/brox.html
http://www.allmyfaqs.com/faq.pl?How_to_post

--
Brian
follow the directions in my address to email me

Jul 20 '05 #8
Richard Silverstein wrote:
Users can set a default font in their browser. Don't try to
override their wishes. Leave the font size of the body element
alone.


I've made the font size changes you suggested to 100%. My display
shows the fonts bigger than they were before & perhaps a bit bigger
than I'd prefer.


Not a problem, not at all. Just change the default size in your
browser. Anyone using a graphical computer browser can set their
default font-size. You are a user. Thus, you too can set this size.
Then, when you view your site, the font-size will be perfect for you.
Better still, when you view other properly made sites, your font-size
will be perfect there, too. :)

Now, which browser do you use? Somewhere here likely uses the same
browser, and will be able to help you.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #9
Richard Silverstein wrote:
Here's the current code:

<style type="text/css">
<!--
DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Richard Silverstein's Photo Galleries at pbase.com

Should the correct coding look something like this?

<style type="text/css">
Richard Silverstein's Photo Galleries at pbase.com


No. The *only* text in the <style> element should be style rules and
comments. Like this:

<style type="text/css">

body {
font-size: 100% ;
}
h1 {
font-size: 140% ;
}
h2 {
color: black ;
background: white ;
}
A:hover, A:focus {
text-decoration: none ;
}
ADDRESS, .address {
margin-top: 2em;
margin-bottom: .7em ;
clear: both ;
}
/* etc. */

</style>

--
Brian
follow the directions in my address to email me

Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Michael Hill | last post by:
I have a perl script that i use to render a html page. In that page i call out a stylesheet. If the user has a 800x600 display the fonts are really too big. Since screen resolution is a function...
4
by: Catherine Lynn Smith | last post by:
OK, I am learning my way around the new DOM, but I am still at a loss on finding a few things. I have an HTML document that links to a stylesheet. /* START STYLESHEET EXAMPLE */ /*...
2
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: August 28, 2002 Version: 1.15 URL: http://css.nu/faq/ciwas-aFAQ.html...
0
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: April 10, 2003 Version: 1.16 URL: http://css.nu/faq/ciwas-aFAQ.html Maintainer:...
14
by: theo | last post by:
if I have nested div combinations, can I call for styles only to specific nested combos? It's 3 lists <li>, on one page, needing different styles. <div id=list1><li> <a id="t1"...
1
by: Paul | last post by:
Is there a special way to reference a Stylesheet (.css) in a usercontrol? I have a usercontrol in an aspx page.The aspx page itself has a Header Div, within which I put my UserControl.ascx. In the...
2
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no...
31
by: Sarita | last post by:
Hello, this might sound stupid, but I got a really nice homepage template which unfortunately is a 3-Column Fixed Width CSS format. Now I don't have any content for the right column and would...
2
by: Paulson | last post by:
HI all I got a problem with my menu display.I am making a list as shown below in one of my aspx pages. And added a stylesheet in CSS for it. This is not working in IE but not in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.