CSS declarations not working?

  • Tazel
  • Student
  • Student
  • Tazel
  • Posts: 97

Post 3+ Months Ago

I've tried validating my css and the only problem the validator has a problem with is the scrollbar. I've checked to see if it was all right and everything seems to be in order. This is the buggy part:

Code: [ Select ]
BODY
            {
                margin: 0;
                cursor: default;
                /*FROM HERE*/
                scrollbar-face-color: #336699;
                scrollbar-highlight-color: #CCCCCC;
                scrollbar-3dlight-color: #6699CC;
                scrollbar-darkshadow-color: #000000;
                scrollbar-shadow-color: #000000;
                scrollbar-arrow-color: #6699CC;
                scrollbar-track-color: #000000;
                /*TO HERE***/
                font-family: verdana, sans-serif;
                font-size: 10px;
                background-color: #FFFFFF;
                color: #000000;
                font-weight: normal;
            }
  1. BODY
  2.             {
  3.                 margin: 0;
  4.                 cursor: default;
  5.                 /*FROM HERE*/
  6.                 scrollbar-face-color: #336699;
  7.                 scrollbar-highlight-color: #CCCCCC;
  8.                 scrollbar-3dlight-color: #6699CC;
  9.                 scrollbar-darkshadow-color: #000000;
  10.                 scrollbar-shadow-color: #000000;
  11.                 scrollbar-arrow-color: #6699CC;
  12.                 scrollbar-track-color: #000000;
  13.                 /*TO HERE***/
  14.                 font-family: verdana, sans-serif;
  15.                 font-size: 10px;
  16.                 background-color: #FFFFFF;
  17.                 color: #000000;
  18.                 font-weight: normal;
  19.             }
  • Tazel
  • Student
  • Student
  • Tazel
  • Posts: 97

Post 3+ Months Ago

Does anyone know why my css declarations are not working?

here's a link. (For the source, right click -> View Source)

http://www.maxedge.net/maxtest.html
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23458
  • Loc: Woodbridge VA

Post 3+ Months Ago

I'm assuming that you are refering to the scrollbar colors?

The short answer is because your Doctype Declaration (DTD) is correct. Yes, I did say that the way I intended to your DTD is CORRECT.

That's what's causing the colored scrollbars not to work. What you currently have as your DTD is what the W3C recommends:

Code: [ Select ]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" >


If you change it to this:
Code: [ Select ]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

your scrollbar colors will show up.

Here's the long version. Every browser already has the DTDs built into them. Netscape Mozilla and others are much closer if not the identical ones the W3C has. IE is different and includes all their cute little proprietary stuff. That's why all their programs like Frontpage, for example, only include the truncated version.

When you include it as you did, the browser looks to the W3C DTD specified in the link -- in your case: http://www.w3.org/TR/html4/loose.dtd You can actually read the document by clicking that link if you're interested. Anyway, by including that link in the DTD, the browser skips any internal ones and goes to the source -- the actual W3C document. So by including it, it did not contain the information it needs to understand what to do with the scrolling attributes. By excluding it, IE reverts to it's internal DTD and displays it.

Hope that helps.

P.S. I merged your other post with this one because it's related to the same topic.
  • Tazel
  • Student
  • Student
  • Tazel
  • Posts: 97

Post 3+ Months Ago

Thanks, that is one question solved, although the CSS thread really wasn't talking about that. I mean like in maxedge.net/maxtest.html, my div bars are a lot longer than their actual content. Why is this?
  • Tazel
  • Student
  • Student
  • Tazel
  • Posts: 97

Post 3+ Months Ago

ATNO/TW wrote:
I'm assuming that you are refering to the scrollbar colors?

The short answer is because your Doctype Declaration (DTD) is correct. Yes, I did say that the way I intended to your DTD is CORRECT.

That's what's causing the colored scrollbars not to work. What you currently have as your DTD is what the W3C recommends:

Code: [ Select ]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" >


If you change it to this:
Code: [ Select ]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

your scrollbar colors will show up.

Here's the long version. Every browser already has the DTDs built into them. Netscape Mozilla and others are much closer if not the identical ones the W3C has. IE is different and includes all their cute little proprietary stuff. That's why all their programs like Frontpage, for example, only include the truncated version.

When you include it as you did, the browser looks to the W3C DTD specified in the link -- in your case: http://www.w3.org/TR/html4/loose.dtd You can actually read the document by clicking that link if you're interested. Anyway, by including that link in the DTD, the browser skips any internal ones and goes to the source -- the actual W3C document. So by including it, it did not contain the information it needs to understand what to do with the scrolling attributes. By excluding it, IE reverts to it's internal DTD and displays it.

Hope that helps.

P.S. I merged your other post with this one because it's related to the same topic.


BTW, I have some elements that are valigned top but when I had the long version of the dtd, it wouldn't work, but now i truncated it, it works as intended. Is this the same reason?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23458
  • Loc: Woodbridge VA

Post 3+ Months Ago

I could take a look again for you and probably tell you, but let me say this. The "long" version we've been refering to is the "standard" set forth by the W3C. If it's not working quite the way you envisioned it, you probably have something that's not quite right "according to standards". Most often than not it's probably how you coded it within your tables/td elements. Although I don't believe it's been made a standard yet, I believe the W3C's current recommendation is to use CSS wherever possible instead of tables. I'll give you a day or so to look at it and ponder it and if you haven't come up with an answer, I'll take a look again.

I know it's rough to hear that kinda answer when you want to do it "right away", but trust me...you'll understand it better if you take the ball and roll with it.

P.S. MSIE "overlooks" a variety of evils in coding to standards. If you want to see how it truly looks test it in NS 7+ or Mozilla browsers. They are more accurate.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 19 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.