View Full Version : Why Won't My CSS Work??


Jocelyn
08-06-2004, 06:14 PM
For some strange reason, my CSS won't work. Is there something wrong with my code:

<style type="text/css">

<font face="verdana" size="1" color="black">

<div style="position:absolute; left: 0px; top: 0px;">

BODY {
scrollbar-3dlight-color: #A8A8A8;
scrollbar-arrow-color: #FFFFFF;
scrollbar-base-color: #A8A8A8;
scrollbar-darkshadow-color: #A8A8A8;
scrollbar-face-color: #E55994;
scrollbar-highlight-color: #A8A8A8;
scrollbar-shadow-color: #A8A8A8;
scrollbar-track-color: #A8A8A8;
}

<!--
A:link { text-decoration: none; color:#E55994; }
A:visited { text-decoration: none; color:#E55994; }
A:hover { text-decoration: none; color:#FFFFFF; }
-->

</style>

or is there something wrong with my link:

<LINK href="http://freewebs.com/jessicaonline/style.css" rel="stylesheet" type="text/css">

Shirl
08-06-2004, 06:24 PM
That's an external CSS right? Try taking out the style tags. :) (I give Monkey Bizzle all credit for my knowledge of external CSS) :D

lefty
08-06-2004, 06:25 PM
The link is fine, but there are few things that are in your stylesheet that shouldn't be there. I've bolded them.


<style type="text/css">

<font face="verdana" size="1" color="black">

<div style="position:absolute; left: 0px; top: 0px;">

BODY {
scrollbar-3dlight-color: #A8A8A8;
scrollbar-arrow-color: #FFFFFF;
scrollbar-base-color: #A8A8A8;
scrollbar-darkshadow-color: #A8A8A8;
scrollbar-face-color: #E55994;
scrollbar-highlight-color: #A8A8A8;
scrollbar-shadow-color: #A8A8A8;
scrollbar-track-color: #A8A8A8;
}

<!--
A:link { text-decoration: none; color:#E55994; }
A:visited { text-decoration: none; color:#E55994; }
A:hover { text-decoration: none; color:#FFFFFF; }
-->

</style>

Only css tags are supposed to be in a stylesheet; the rest goes in the HTML on your page. As for the style tags, the style is already defined by the external stylesheet link, so you do not need them twice (certain things also may not work if they are there).

As a side note, your link properties should be before the body attributes.


edit: it's not bolding the --> for some reason, but it should be :P

Jocelyn
08-06-2004, 06:29 PM
Thanks. I just started doing CSS today and I guess I must not have understood a few things. It works now.

lefty
08-06-2004, 06:32 PM
Quite all right, we all start somewhere ;)

Something I forgot to mention... if you want to put your font stuff in your css (as I see you've tried to do), you can do it this way:

font-family:verdana;
font-size:10pt;
color:black;

you'd put that in the BODY properties, right after (or before, doesn't really matter) the scrollbar stuff. You can also change the font size if you want, I was just guessing. :P

Monkey Bizzle
08-06-2004, 09:13 PM
...I give Monkey Bizzle all credit for my knowledge of external CSS...
LOL!

Shirl
08-06-2004, 09:18 PM
'Tis only fair to credit those who provide me with knowledge to add to my growing collection, no? :D