Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Just started CSS

0 views
Skip to first unread message

JennyC

unread,
Nov 22, 2004, 1:58:02 PM11/22/04
to
Hi

I've just recently started with CSS and when I put the code in the page all is
well. However when I try to use an external /css file it won't work :~(

Could some kind person please shed some light on this before I go completely
crazy?

Here's the .css file (for a coloured scroll bar):

{ scrollbar-base-color:#999999; scrollbar-face-color:#cccccc;
scrollbar-shadow-color:E15A00;
scrollbar-highlight-color:999999; scrollbar-3dlight-color:E15A00;
scrollbar-darkshadow-color:cccccc;
scrollbar-track-color:#green; scrollbar-arrow-color:#E15A00; }

And here's the code in the page:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel=stylesheet href="testCSS.css" type="text/css">

<font color="#0000FF">test CSS
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
</font>
</body>
</html>

TIA Jenny


mscir

unread,
Nov 22, 2004, 5:11:10 PM11/22/04
to
JennyC wrote:

> I've just recently started with CSS and when I put the code in the page all is
> well. However when I try to use an external /css file it won't work :~(
>

> { scrollbar-base-color:#999999; scrollbar-face-color:#cccccc;
> scrollbar-shadow-color:E15A00;
> scrollbar-highlight-color:999999; scrollbar-3dlight-color:E15A00;
> scrollbar-darkshadow-color:cccccc;
> scrollbar-track-color:#green; scrollbar-arrow-color:#E15A00; }

<snip>

If the style works in your page you probably forgot to copy it
correctly, everything between the <style> ... </style> tags has to go
into the external stylesheet. e.g. body {...}.

Also, your colors don't all begin with a pound symbol: #
http://www.htmlhelp.com/reference/css/units.html#color

body {
scrollbar-base-color: #999999;
scrollbar-face-color: #cccccc;
scrollbar-shadow-color: #E15A00;
scrollbar-highlight-color: #999999;
scrollbar-3dlight-color: #E15A00;
scrollbar-darkshadow-color: #cccccc;
scrollbar-track-color: #green;
scrollbar-arrow-color: #E15A00;
}

I'm not sure if this matters but I always put "stylesheet" in quotes:

<link rel="stylesheet" href="testCSS.css" type="text/css">

And the testCSS.css file has to be in the same folder as the pages that
refer to it, since you didn't include any path before the filename.

Mike

JennyC

unread,
Nov 24, 2004, 11:25:22 AM11/24/04
to

"mscir" <ms...@access4less.net> wrote in message
news:10q4p01...@corp.supernews.com...

> JennyC wrote:
>
> > I've just recently started with CSS and when I put the code in the page all
is
> > well. However when I try to use an external /css file it won't work :~(
> >
> > { scrollbar-base-color:#999999; scrollbar-face-color:#cccccc;
> > scrollbar-shadow-color:E15A00;
> > scrollbar-highlight-color:999999; scrollbar-3dlight-color:E15A00;
> > scrollbar-darkshadow-color:cccccc;
> > scrollbar-track-color:#green; scrollbar-arrow-color:#E15A00; }
> <snip>
>
> If the style works in your page you probably forgot to copy it
> correctly, everything between the <style> ... </style> tags has to go
> into the external stylesheet. e.g. body {...}.

Don't think so Mike. the above is exactly what i have in the .css
file..................

> Also, your colors don't all begin with a pound symbol: #
> http://www.htmlhelp.com/reference/css/units.html#color
>
> body {
> scrollbar-base-color: #999999;
> scrollbar-face-color: #cccccc;
> scrollbar-shadow-color: #E15A00;
> scrollbar-highlight-color: #999999;
> scrollbar-3dlight-color: #E15A00;
> scrollbar-darkshadow-color: #cccccc;
> scrollbar-track-color: #green;
> scrollbar-arrow-color: #E15A00;
> }
>
> I'm not sure if this matters but I always put "stylesheet" in quotes:
> <link rel="stylesheet" href="testCSS.css" type="text/css">

Doesn't seem to make any difference !! To my surprise it works with or without
the #

> And the testCSS.css file has to be in the same folder as the pages that
> refer to it, since you didn't include any path before the filename.
> Mike

All files are in the same directory.

I was wondering whether it has to do with the fact that the css is used in a
inline frame. Should I perhaps put the 'get css file' command in the main page
or the inline frame page ??

test page at: http://members.rott.chello.nl/ldejager2/KSPD2004WGW/index.htm

Jenny


mscir

unread,
Nov 24, 2004, 5:13:25 PM11/24/04
to
JennyC wrote:
> "mscir" <ms...@access4less.net> wrote in message
> news:10q4p01...@corp.supernews.com...
>
>>JennyC wrote:
>>
>>>I've just recently started with CSS and when I put the code in the page all is
>>>well. However when I try to use an external /css file it won't work :~(
>>>
>>>{ scrollbar-base-color:#999999; scrollbar-face-color:#cccccc;
>>>scrollbar-shadow-color:E15A00;
>>> scrollbar-highlight-color:999999; scrollbar-3dlight-color:E15A00;
>>>scrollbar-darkshadow-color:cccccc;
>>> scrollbar-track-color:#green; scrollbar-arrow-color:#E15A00; }
>>
>><snip>
>>
>>If the style works in your page you probably forgot to copy it
>>correctly, everything between the <style> ... </style> tags has to go
>>into the external stylesheet. e.g. body {...}.
>
>
> Don't think so Mike. the above is exactly what i have in the .css
> file..................

I think a good place to start is making sure your CSS and HTML are
valid. Here are a couple of pages you can use to do that:
======================================================================
Validate your CSS using this page:

http://jigsaw.w3.org/css-validator/

W3C CSS Validator Results for
http://members.rott.chello.nl/ldejager2/KSPD2004WGW/index.htm

To work as intended, your CSS style sheet needs a correct document parse
tree. This means you should use valid HTML.

Errors
URI : http://members.rott.chello.nl/ldejager2/KSPD2004WGW/index.htm

* Line: 22

Parse error - Unrecognized : {margin: 0; overflow:auto;}
======================================================================
Validate your HTML using this page:

http://www.htmlhelp.com/tools/validator/
http://www.htmlhelp.com/cgi-bin/validate.cgi?url=http%3A%2F%2Fmembers.rott.chello.nl%2Fldejager2%2FKSPD2004WGW%2Findex.htm&warnings=yes


> I was wondering whether it has to do with the fact that the css is used in a
> inline frame. Should I perhaps put the 'get css file' command in the main page
> or the inline frame page ??

Google for examples of formatting iframes with css, e.g.

http://forums.devshed.com/archive/t-39797

MIke

JennyC

unread,
Nov 25, 2004, 4:54:59 AM11/25/04
to

"mscir" <ms...@access4less.net> wrote

> JennyC wrote:
> > "mscir" <ms...@access4less.net> wrote
> >>JennyC wrote:
> >>
> >>>I've just recently started with CSS..........<snip>

Thanks for the URLs Mike.

The reason it was not working was that I'd put the link to the css file in the
body and not the header !

That's what you get by being an auto didactic :~)

Thanks for your comments. Jenny


0 new messages