473,607 Members | 2,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2856
Richard Silverstein <ri**********@c omcast.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****@stanford alumni.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**********@co mcast.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****@stanfor dalumni.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.448 40$H17.13673@sc crnsc02>...
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
14531
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 of the client and I have this javascript ot detect the srecc size: function ck_res() { if ( (screen.width != 1024) && (screen.height != 768) ) {
4
3297
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 */ /* styles/mystyles.css */ ..leftnav { font-family: Arial, Helvetica, sans-serif; font-size: 13pt;
2
2814
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 Maintainer: Jan Roland Eriksson <rex@css.nu> ciwas stylesheet authoring FAQ v1.15 ______________________________________________________________________
0
1950
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: Jan Roland Eriksson <rex@css.nu> ciwas stylesheet authoring FAQ v1.16 ______________________________________________________________________
14
6610
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" href=...>main</a></li><div> <div id=list2><li> <a id="t1" href=...>main</a></li><div> <div id=list3><li> <a id="t1" href=...>main</a></li><div>
1
8784
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 UserControl I want to use DIVS only, just to make work easier at a future point. So, I have an outer Div called HeaderContainer, and then some contained divs. If this were just an aspx page, then all the rendering is fine, but when I try to do...
2
6970
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 header. I tried to put the link tag in the Master page, but the classes are not recognized in the Content Page. How do I use a StyleSheet with the Content Page? TIA
31
3082
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 like the middle column just to use up that space instead. Any way this is possible? Thanks for your help, it is highly appreciated!
2
1532
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 Mozilla Firefox it is working. Can anyone please help me with this? Just after the page html I pasted my CSS stylesheet code also. __________________________________________________________________
0
7985
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6803
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5997
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3953
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4013
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2461
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.