PDA

View Full Version : XP Scrollbar Colouring



abbi
04-17-2006, 11:36 PM
I have always used the same code whenever customizing the colour of a scrollbar, but I have never had an XP computer to test my sites on until now.
When I added in the code for the scrollbar colour it changed the traditional XP style scrollbar to the windows 2000/98 scrollbar style.
Here's the code, does anyone know why this is? And if there's a way to fix that.

<style type="text/css">
<!--
body
{
scrollbar-arrow-color: 000000;
scrollbar-track-color: 000000;
scrollbar-face-color: 000000;
scrollbar-highlight-color: 000000;
scrollbar-3dlight-color: 000000;
scrollbar-darkshadow-color: 000000;
scrollbar-shadow-color: 000000;
}
-->
</style>


And one more question, is there a way to customize the style of the scrollbar without using Flash? Somehow Im doubting that there is, because I haven't seen it done yet.

Twey
04-18-2006, 09:42 AM
<style type="text/css">
<!--
body
{
scrollbar-arrow-color: 000000;
scrollbar-track-color: 000000;
scrollbar-face-color: 000000;
scrollbar-highlight-color: 000000;
scrollbar-3dlight-color: 000000;
scrollbar-darkshadow-color: 000000;
scrollbar-shadow-color: 000000;
}
-->
</style>I was going to go through and highlight invalid CSS, then realized it would be easier to highlight the valid code, since there were only five lines of it.

Scrollbar-colour code is proprietary and IE-only. Only users of one browser out of many will so much as see the effects of your code. Is that really worth invalidating (http://jigsaw.w3.org/css-validator/) your CSS for? I wouldn't really worry about minor style differences under the glare of so much bigger a problem.

Numerical colour values should start with a hash (#), and SGML comment delimiters have no business being inside a stylesheet. Javascript makes provision for this by declaring <!-- a line-comment marker; CSS doesn't.
Here's the code, does anyone know why this is? And if there's a way to fix that.It is because XP scrollbars have their colours hard-coded, and can't be changed. But what makes you think it's broken? If anything, I'd say it's an improvement over the standard Teletubby-style XP decorations.
is there a way to customize the style of the scrollbar without using Flash?No. But it can be replaced using DHTML. Search for "scroller" here on DD.

mwinter
04-18-2006, 09:52 AM
Javascript makes provision for this by declaring <!-- a line-comment marker; CSS doesn't.Incorrect, though not something I'd recommend.

Only markup should contain markup comment delimiters, and neither script not style element content has required 'hiding' in years.

Mike

Twey
04-18-2006, 09:56 AM
Incorrect, though not something I'd recommend.Really? Firefox complains when it encounters <!-- in a CSS block.

mwinter
04-18-2006, 04:29 PM
[CSS allows SGML comment declarations] Really?Yep. It's in the grammar. From the lexical rules:



"<!--" {return CDO;}
"-->" {return CDC;}
From the parser grammar:



stylesheet
: [ CHARSET_SYM S* STRING S* ';' ]?
[S|CDO|CDC]* [ import [S|CDO|CDC]* ]*
[ [ ruleset | media | page | font_face ] [S|CDO|CDC]* ]*



Firefox complains when it encounters <!-- in a CSS block.Firefox does complain about a lot, but I did say I don't recommend it. :D

Mike

jscheuer1
04-18-2006, 05:34 PM
Firefox does complain about a lot, but I did say I don't recommend it. :D

And, it (Firefox) seems to complain more and more with each new version. It's getting uppity if you ask me. :cool: Is there anyway to get it to skip complaining (like the earlier versions skipped complaining) so much about things that don't break either the code or the page? I actually find this new information useful many times but, would love a toggle for when I just want to get right to the heart of the matter with a troublesome page.

Twey
04-18-2006, 05:53 PM
Is there anyway to get it to skip complaining (like the earlier versions skipped complaining) so much about things that don't break either the code or the page?Unfortunately, not. Great idea for an extension, though, along with some other Javascript console enhancements (seperation of JS info, CSS info, interface/extensions info, and perhaps a seperate console for each page). I'll do it if/when I have time.

mwinter
04-18-2006, 06:10 PM
Is there anyway to get it to skip complaining (like the earlier versions skipped complaining) so much about things that don't break either the code or the page?I know how to get it to complain more. :p

Mike

djr33
04-18-2006, 07:25 PM
I know that IE 5 will ignore anything after an open comment... probably not telling you something you don't know, though. But... just remember older browsers might not behave the same way...

jscheuer1
04-18-2006, 09:53 PM
I know how to get it to complain more. :p

Mike

Depending upon what you mean by that, it could be useful for certain situations, could you elaborate please?

Also, in working with a client, it recently came up about the (I believe it is the w3c standard) requirement for alt attributes for image tags, even if they are empty. We were both just wondering if there were any logical and/or practical reason for this? How much better is an empty alt attribute than none at all? I notice that this is a requirement for validation so again, what if any useful purpose does the empty alt attribute serve? I was stumped but, knew that if anyone would know, you would.

Twey
04-18-2006, 10:04 PM
Just a guess before Mike gets back and tells us the real answer, but I'd say it was because people are more likely to think before putting in an empty alt attribute, while they might leave it off altogether without even knowing it was meant to be there.

djr33
04-19-2006, 05:43 AM
Maybe it'll at least tell screenreader's there's an image there, but that it wasn't described.... might make it clearer to someone... but seems they could do that with the absense of the tag anyway.
Seems dumb to me.

mwinter
04-19-2006, 01:17 PM
I know how to get it to complain more.Depending upon what you mean by that, it could be useful for certain situations, could you elaborate please?In the advanced configuration options for Firefox (type about:config in the address bar), there is a boolean option named 'javascript.options.strict'. When enabled, this would add additional warnings to the JavaScript Console. However, some of the warnings are misinformed or just plain wrong, so I wouldn't recommend it.

An article describes some of these problems with the strict option (http://www.howtocreate.co.uk/strictJSFirefox.html). It also pointed out that Chris Pederick's Web Developer extension can control this option, which seems to be enabled by default upon installing the extension (see Miscellaneous > JavaScript > Enable strict JavaScript warnings in the toolbar Options panel). That might be why you're seeing a lot of messages, John.



Also, in working with a client, it recently came up about the (I believe it is the w3c standard) requirement for alt attributes for image tags, even if they are empty. We were both just wondering if there were any logical and/or practical reason for this?Indeed there is: the author is the only person in a position to specify what the alternative to that image should be.


How much better is an empty alt attribute than none at all?A user agent could assume that the default should be the empty string, and for the majority of decorative images (but not necessarily all), that would be fine. However, it isn't just decorative images that are ignored by authors, and the visitor might well want (or even need) to know when an image is present. For instance, a dial-up user might have disabled images for reasons of expediency, but may choose to view specific, content-related images.

A user agent could go the other way, and replace images with '' when the alt attribute is omitted. However, this can be disasterous when the author makes a habit of omitting alternative text.

[i]Any assumed replacement is substandard.


I notice that this is a requirement for validation so again, what if any useful purpose does the empty alt attribute serve?An empty alt attribute value indicates that image in question has no content. That, when the image cannot be displayed, nothing is the replacement. Decorative images are prime candidates. However, the empty string isn't always best: whitespace may be better if the image provides spacing as well as decoration. Similarly, if the image is amongst text - especially text without punctuation, such as in menus - or is a bullet in a list, then a punctuation character is a better substitute.


Alan J. Flavell has a fair bit to say on the use of alternative text (http://ppewww.ph.gla.ac.uk/~flavell/alt/alt-text.html). Special attention should be paid to the howlers (http://ppewww.ph.gla.ac.uk/~flavell/alt/alt-text.html#howlers), keeping in mind that the default value provided by user agents can be just as nonsensical as some of the examples there. Imagine how confusing it might be to use a screen reader (Opera Voice should allow you to experience that).

Mike

jscheuer1
04-19-2006, 03:13 PM
Thanks Mike. Both of my strict options were off/false. When I'm really bored, I'll turn them on, just to see. The explanation of the empty alt attribute - stellar, as usual.

abbi
04-22-2006, 08:19 PM
<style type="text/css">
<!--
body
{
scrollbar-arrow-color: 000000;
scrollbar-track-color: 000000;
scrollbar-face-color: 000000;
scrollbar-highlight-color: 000000;
scrollbar-3dlight-color: 000000;
scrollbar-darkshadow-color: 000000;
scrollbar-shadow-color: 000000;
}
-->
</style>I was going to go through and highlight invalid CSS, then realized it would be easier to highlight the valid code, since there were only five lines of it.

Scrollbar-colour code is proprietary and IE-only. Only users of one browser out of many will so much as see the effects of your code. Is that really worth invalidating (http://jigsaw.w3.org/css-validator/) your CSS for? I wouldn't really worry about minor style differences under the glare of so much bigger a problem.

Numerical colour values should start with a hash (#), and SGML comment delimiters have no business being inside a stylesheet. Javascript makes provision for this by declaring <!-- a line-comment marker; CSS doesn't.It is because XP scrollbars have their colours hard-coded, and can't be changed. But what makes you think it's broken? If anything, I'd say it's an improvement over the standard Teletubby-style XP decorations.No. But it can be replaced using DHTML. Search for "scroller" here on DD.

I don't really care if other browsers see it or not, seeing as how I am a page designer 99% of the time those pages are never seen online. I make them the way I want to view them, not the way other people want to view them. Call that bad designing but I don't see a problem with make my pages the way I want to make them.
I would like to thank you for your "help", even though your comments about not worring about the style difference under the glare of a much bigger problem, were a little annoying. Because I wasn't asking for advice, I asked if there was a way to change this. Obviously there aren't.

By the way, the code that I pasted was aquired from none other than our wonderful DD. Talk to them about the hash (#), and any other invalidness in it.

jscheuer1
04-22-2006, 09:28 PM
By the way, the code that I pasted was aquired from none other than our wonderful DD. Talk to them about the hash (#), and any other invalidness in it.

There was a time when the # mark was not required. I don't know if that was ever true in IE but, it might have been. It isn't the case now.

mwinter
04-22-2006, 10:06 PM
There was a time when the # mark was not required. I don't know if that was ever true in IE but, it might have been. It isn't the case now.One of the fixes to IE 6 (http://msdn.microsoft.com/library/en-us/dhtmltechcol/dndhtml/cssenhancements.asp?#cssenhancements_topic7) involved tightening the CSS parser.

The hash (#) symbol has always been required for hexadecimal colour notation, in both HTML and CSS.

Mike

jscheuer1
04-22-2006, 10:22 PM
The hash (#) symbol has always been required for hexadecimal colour notation, in both HTML and CSS.

Right you are but, there have been and perhaps continue to be other browsers that let you slide on this one, making it confusing for the coder/designer who doesn't go by standards and/or test in a wide variety of browsers.

The DD script in question most probably was written around the time when IE did support the use of hex colors without the hash. The big three still support this:

<body text=ff0000>

and inline style like it in quirks mode, Opera and IE support the above even in transitional mode.

mwinter
04-22-2006, 11:02 PM
Right you are but, there have been and perhaps continue to be other browsers that let you slide on this one, making it confusing for the coder/designer who doesn't go by standards and/or test in a wide variety of browsers.I did mean to comment on Quirks mode. Apparently I forgot. :rolleyes:

This is the problem with error correction: when authors use it without realising, they're unwittingly producing poor code. Error correction is a necessary evil, but it's self-perpetuating. In an ideal world, it wouldn't have been introduced in the first place (or, even better, it wouldn't have been needed in the first place :)).


The big three still support this:

<body text=ff0000>

and inline style like it in quirks mode, Opera and IE support the above even in transitional mode.True, but HTML is always slurped up by a tag-soup parser, whereas CSS parsers tend to undergo more radical changes when influenced by DOCTYPE switching.

Mike