7 replies [Last post]
kelly63
Offline
newbie
South Carolina
Last seen: 17 years 22 weeks ago
South Carolina
Joined: 2003-05-18
Posts: 3
Points: 0

Hi everyone,

My first post here. Also, I'm just learning css, so bear that in mind when you look at my code. Smile

Problem. I've tried to change my site's scrollbar colors. I've tried putting the code in the head tag, I've tried linking my "scroll.css" file in my root directory to my pages (external link?) and nothing works. I've placed the code in the body tag. Nothing.

Strange thing is that out of approx. 200 pages on my site, ONE lone page does show the scrollbar color changes. The others don't, and I can't see why! This one page where it does show up looks no different than the others.

Here is my URL: http://www.titanpersonalsafety.com

To view the one page that does show my scrollbar color changes, from the Nav Bar, click on Home Protection, then Voice Alert. On the Voice Alert page, click on the Voice Alert FAQ's. Ta-da!

Any help is appreciated. This has been driving me nuts!

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 2 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Can't get my css to "work"

Hi Kelly63,
You should try to link the style sheet as it will make your site easier to maintain in the long run.

I'll have a closer look after work to try and find the cause of your problem Smile

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 4 years 38 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

Can't get my css to "work"

Aha!

The DOCTYPE isn't the first thing in some pages, I've got a feeling this could be the cause.

As the scrollbars aren't 'proper' CSS, if you declare a DOCTYPE properly, they will be ignored (?). In that one page there's a <p> tag before it, meaning IE can do what it want.

Well that's my theory anyway, the CSS is identical, can't see what else it may be.

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 2 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Can't get my css to &quot;work&quot;

Yes your right DJomp, the doctype should be the first thing.

If you remove the doctype completely the scrollbars show the colors :roll:

Try to validate the markup code http://validator.w3.org/ it will show many other errors as well.
Most of them are for not closing tags such as font tags.
You should fix them, sorry thats a big job with so many pages.

Maybe you should look for a more forgiving doctype.
Anyway its not all bad news the css is not so bad, although I would remove the

Quote:
scrollbar-shadow-color: ""

and make sure all style tags are within the head section of the document.
In fact since you have so many pages really linking to the css is the best way to go.

Hope that helps
Tony

kelly63
Offline
newbie
South Carolina
Last seen: 17 years 22 weeks ago
South Carolina
Joined: 2003-05-18
Posts: 3
Points: 0

Can't get my css to &quot;work&quot;

Wow, just had a look on that one page, and I have no idea why there was a <p> tag there at the top before the DOCTYPE. Hmm... I sure didn't put it there!

Anyway, it must've had something to do with it. I've taken it out and my scrollbar color disappeared. I do know I need to move my css to external file. It's an arduous task initially, but I know that's what I need to do.

So my understanding is that everything css should be placed in the HEAD tags?? At least for the most part?

I'm still looking for answers to the scrollbar questions. Thank you to all who replied! Laughing out loud

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 4 years 38 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

Can't get my css to &quot;work&quot;

The answer to the scrollbar question is hidden somewhere above...

If you include the DOCTYPE then IE will ignore the scrollbar colors. If you don't put a DOCTYPE (or indeed don't declare it properly Wink) then IE will do the colours.

This is because the scrollbars aren't proper CSS, so declaring a proper DOCTYPE will force the browser to ignore the scrollbar properties.

Neither the strict or transitional HTML doctypes allow them either...

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.

kelly63
Offline
newbie
South Carolina
Last seen: 17 years 22 weeks ago
South Carolina
Joined: 2003-05-18
Posts: 3
Points: 0

Can't get my css to &quot;work&quot;

My understanding is that it's important to have the DOCTYPE declared. (?) If so, I'd imagine it's better to have that in my code than some fancy scrollbar colors? :?

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 4 years 38 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

Can't get my css to &quot;work&quot;

Yeah, that would be my opinion too.

Declaring the DOCTYPE should make the browsers render the page the same - well more so than not using one!

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.