...

View Full Version : CSS not functioning - XML the cause?



JWGlenn
11-24-2002, 02:59 AM
I am having problems getting my CSS to funciton properly. Now, I just recently began using XML code, and that's what my DOCTYPE is listed as (transitional) ... could this be the reason for the problem?

If not, what other possibilities are there?

Grant Palin
11-24-2002, 05:54 PM
Yeah, actually, I just converted y site from HTML to XHTML, and now some of my CSS doesn't work now. I'm using XHTML Transitional: could that have something to do with it?

jkd
11-24-2002, 07:38 PM
It helps to see it? :)

Grant Palin
11-24-2002, 08:22 PM
body {
font: 10pt Arial, Helvetica, sans-serif;
color: #000000;
background: #FFEDAD url(tangradient.jpg) repeat-y;

cursor:url("WandCursor.cur");

scrollbar-face-color:#C09000;
scrollbar-arrow-color:black;
scrollbar-track-color:#c0c0c0;
scrollbar-shadow-color:'';
scrollbar-highlight-color:'';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}

A {text-decoration:none;}
A:link {color:#0054A6;}
A:visited {color:#D21F3F;}
A:active {color:#A687BE;}
A:hover {color:#E3A52A;}

td {
font: 10pt Arial, Helvetica, sans serif;
color: #000000;
}

jkd
11-25-2002, 12:13 AM
And what isn't functioning?

Grant Palin
11-25-2002, 01:15 AM
The colored scrollbars. A week ago I had colored scrollbars as indicated by the CSS above. After I converted to XHTML, the colors just disappeared. It's a plain old gray scrollbar now.

http://www.freewebs.com/hommworld/Homm/index.html

Check out my site- you'll see the plain gray scrollbar. Also, I'm now getting a horizontal scrollbar on my main content frame (the bottom one). That started after the XHTML thing too.

Motif Webs
11-25-2002, 02:59 AM
Try taking the "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" out of your doctype declaration. I've had that cause problems with the scrollbars CSS before. Remember, colored scrollbars are not standards-supported CSS.

Neil

Grant Palin
11-25-2002, 03:47 AM
That worked...So I guess that means I have to either get rid of the colors or not bother with being XHTML compliant. Is there any way around it?

Catman
11-25-2002, 04:11 AM
I'd guess you could use javascript and test for IE then set the scrollbar values if true.

brothercake
11-25-2002, 10:18 AM
When you're in standards-compliant mode, the BODY no longer represents the entire canvas; the HTML element does. So you if you attach your scrollbar styles to HTML instead of BODY then it will work:

html {
scrollbar-face-color:#C09000;
scrollbar-arrow-color:black;
scrollbar-track-color:#c0c0c0;
scrollbar-shadow-color:'';
scrollbar-highlight-color:'';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}


This is true for all scrollbar / scrolling properties

Grant Palin
11-26-2002, 02:14 AM
Oooohhh, thanks for that tidbit!:) The scrollbars are colorful again!:thumbsup:

Something else though, if you go back to my site (link in previous post), at 800 by 600 resolution, you'll notice a horizontal scrollbar in the content frame. Would that be caused by XHTML in some way? There was no horizontal scrollbar before.

Motif Webs
11-26-2002, 02:56 AM
Originally posted by Motif Webs
Try taking the "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" out of your doctype declaration. I've had that cause problems <edit> before - still means you're compliant.</edit>

Neil

Grant Palin
11-26-2002, 03:37 AM
That worked- I just tried it on my main content page, and only the vertical scrollbar remained. Could there be something wrong with my HTML causing that? Here's the source for that page I mentioned, including the DTD.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

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

<meta name="Heroes of Might and Magic 1" content="HOMM, Heroes of Might and Magic, A Strategic Quest, artifacts, heroes, troops, castles, towns, spells, skills, scenarios, campaigns, pictures, strategies, cheats, links, downloads, where to buy, 3DO, New World Computing, NWC" />
<title>Heroes of Might and Magic Homepage</title>
</head>

<body onload="top.document.title = document.title;">

<center><img src="HOMM_title.gif" width="354" height="149" border="0" alt="Heroes of Might and Magic" /></center><br />
<h3>Welcome</h3>

<p>Welcome, weary traveler! You are here because you are interested in learning more about Heroes of Might and Magic, right? Read onward!</p>

<h3>What is Heroes of Might and Magic?</h3>

<p>Heroes of Might and Magic: A Strategic Quest (HOMM for short) was produced by <a href="http://www.3do.com">3DO</a> in 1995. It is now the first chapter in the highly acclaimed Heroes of Might and Magic series. However, the subject of this site is solely on the first game. HOMM is a strategy-war type of game. You have to manage resources, while battling your opponents at the same time. You must capture and build up castles to gain more powerful troops, or surely your opponents will annihilate you... This game has almost unlimited replay potential, since you can use different strategies every time you play. It is turn-based, unlike real-time games like Warcraft and Starcraft. I prefer HOMM, because unlike the aforementioned games, you don't have to be everywhere at once! They do have their high points, such as fast-paced action, which some people do like... But that's off-topic. On this website, I will tell you as much as I can; HOMM is a complex game. I will provide information on the heroes, artifacts, creatures, and more (in short, pretty much everything)! So pull up a chair, brew a pot of coffee, and prepare to descend into the world of might and magic.</p>

<h3>Want more?</h3>

<p>Use the buttons in the navigation pane on the left and above to go through my site. I hope you will find the content informative and useful.</p>

<h3>Let me know what you think!</h3>

<p>If there is anything you want to say or ask me, you can email me or sign my guestbook. Options for both are on my Contact page.</p>

</body>
</html>

Motif Webs
11-26-2002, 04:49 AM
Nothing wrong with it at all. You get a vertical scrollbar because you have more content than can fit on the page so the browser adds the scrollbar so the user can scroll down and read the content.

Remember, lose the "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" from your doctype declaration or you'll end up with the same problems you started with.

Neil

brothercake
11-26-2002, 05:09 PM
Originally posted by Motif Webs
Remember, lose the "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" from your doctype declaration or you'll end up with the same problems you started with.

Neil


But if you lose the doctype, you will not longer be working with XHTML transitional.

Doctypes, per se, do not cause problems; what causes problems is the (IMO stupid) "quirks" and "compliant" modes of IE6 and mozilla. But even these needn't inherently be a problem unless you have pages of one and pages of the other - choose one, or the other, and work with it consitently.

jkd
11-26-2002, 06:08 PM
Originally posted by brothercake
Doctypes, per se, do not cause problems; what causes problems is the (IMO stupid) "quirks" and "compliant" modes of IE6 and mozilla. But even these needn't inherently be a problem unless you have pages of one and pages of the other - choose one, or the other, and work with it consitently.

IE has "BackCompat" for backwards compatibility. Moz has "Quirks" to render most of the Internet as intended.

IE has "CSS1Compat" to at least correct its horrendous implementation of the box model, while Moz has "Standards-compliant" to be correct.

I like this setup personally. I write all my pages to fire CSS1Compat in IE and Standards in Moz, and they generally look the same. And for all the sites I surf, quirks mode does an excellent job of rendering them as one would expect. (note: Which is *not* the correct way)

If there was no doctype sniffing, IE6 would not be backwards compatible with IE5.5, and Moz would "misrender" more sites, giving more people something to gripe about.

:)

Grant Palin
11-26-2002, 07:54 PM
Originally posted by Motif Webs
Nothing wrong with it at all. You get a vertical scrollbar because you have more content than can fit on the page so the browser adds the scrollbar so the user can scroll down and read the content.

Remember, lose the "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" from your doctype declaration or you'll end up with the same problems you started with.

Neil

Sorry, I should have been more clear. I want the vertical scrollbar, but NOT the horizontal one. That's the one I have a problem with- it wasn't there before I converted to XHTML.

I've kept the dtd, and the page validates. Why should I remove it?

Grant Palin
11-26-2002, 10:54 PM
Okay, to those who posted about doctypes and compatibility and such, could you please rephrase it for me? I'm having a little trouble understanding.

jkd
11-26-2002, 11:22 PM
Originally posted by Grant Palin
Okay, to those who posted about doctypes and compatibility and such, could you please rephrase it for me? I'm having a little trouble understanding.

Sure. There is a thing called "doctype sniffing" and certain doctypes will trigger different rendering modes.

This is done to maintain backwards compatibility.

Simply put: Older browsers are not standards compliant. Neither are most webpages.

Therefore, for a browser to render most pages as intended, it first must make an educated guess whether or not it falls under the category of markup requiring the "bad" renderer, then use it.
Doctypes more often than not are the best way of determining this.

Motif Webs
11-27-2002, 01:17 AM
Okay to make it perfectly clear as it seems I failed to do so last time. I am NOT saying remove the doctype.

I AM saying remove the URL from the doctype declaration.

In other words, Grant currently has:

* <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

I suggest it should be this:

* <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

I'm quite certain that when you do that you will suddenly find your horizontal scroll magically disappears and you WILL still be compliant and WILL still validate.

<dumber than usual>I tink it's all got sumfing to do wif wot jkd says above and I tink it still be a valid doctype declaration.</dumber than usual>

Neil

Grant Palin
11-27-2002, 01:32 AM
Sorry, I forgot about that previous post of yours. I removed the URL from the DTD like you said, and uploaded the changed pages. But, there was no change (so far as I could tell). Here's the address:

http://www.freewebs.com/hommworld/Homm/index.html

Here's the source for the main page in the bottom frame:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

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

<meta name="Heroes of Might and Magic 1" content="HOMM, Heroes of Might and Magic, A Strategic Quest, artifacts, heroes, troops, castles, towns, spells, skills, scenarios, campaigns, pictures, strategies, cheats, links, downloads, where to buy, 3DO, New World Computing, NWC" />
<title>Heroes of Might and Magic Homepage</title>
</head>

<body onload="top.document.title = document.title;">

<center><img src="HOMM_title.gif" width="354" height="149" border="0" alt="Heroes of Might and Magic" /></center><br />
<h3>Welcome</h3>

<p>Welcome, weary traveler! You are here because you are interested in learning more about Heroes of Might and Magic, right? Read onward!</p>

<h3>What is Heroes of Might and Magic?</h3>

<p>Heroes of Might and Magic: A Strategic Quest (HOMM for short) was produced by <a href="http://www.3do.com">3DO</a> in 1995. It is now the first chapter in the highly acclaimed Heroes of Might and Magic series. However, the subject of this site is solely on the first game. HOMM is a strategy-war type of game. You have to manage resources, while battling your opponents at the same time. You must capture and build up castles to gain more powerful troops, or surely your opponents will annihilate you... This game has almost unlimited replay potential, since you can use different strategies every time you play. It is turn-based, unlike real-time games like Warcraft and Starcraft. I prefer HOMM, because unlike the aforementioned games, you don't have to be everywhere at once! They do have their high points, such as fast-paced action, which some people do like... But that's off-topic. On this website, I will tell you as much as I can; HOMM is a complex game. I will provide information on the heroes, artifacts, creatures, and more (in short, pretty much everything)! So pull up a chair, brew a pot of coffee, and prepare to descend into the world of might and magic.</p>

<h3>Want more?</h3>

<p>Use the buttons in the navigation pane on the left and above to go through my site. I hope you will find the content informative and useful.</p>

<h3>Let me know what you think!</h3>

<p>If there is anything you want to say or ask me, you can email me or sign my guestbook. Options for both are on my Contact page.</p>

</body>
</html>

Motif Webs
11-27-2002, 02:50 AM
Interestingly, when I looked at it and did a view source on that particular page in the frameset - home.html - it should the doctype as <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> However, when I saved the entire frameset and then opened up home.html in Homesite there was the doctype sitting up staring at me as <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">

I wonder if that's because of my Homesite settings - could be I guess.

Sure enough when I removed the http://www.etc part of that doctype, saved it and then opened the frameset locally, the horizontal scroll was gone. In other words with a doctype of <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

HOWEVER, when I changed the doctype to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> back came that scroll bar again.

So my next suggestion is to go with a doctype for HMTL 4.01 transitional. I know, it's not what you want to hear, but it's got me baffled as to why when they only change made is to declare it XHTML instead of HTML a horizontal scroll bar should appear.

Sorry, I can't help more, but at least we've gotten closer to identifying the culprit.

<EDIT>I did a bit of a search (Google is my friend) and came across the following:

* http://archives.hwg.org/hwg-techniques/000501c26d56$adbf36c0$3301e40a@oemcomputer (just keep clicking "Next" until you get to the answer)

Actually, given your frameset is HTML 4.01 I don't see why you would want your other pages different.

Neil

Grant Palin
11-27-2002, 03:03 AM
That is funny...Must be something with XHTML and frames.:confused: :confused: Anyway, I put in the HTML 4.01 doctype, and voila, the horizontal scrollbar disappeared. So, thanks for your help, Neil. I guess I'll stick with HTML for now. I'm thinking about ditching frames anyway, so I may be able to move back to XHTML later.

Motif Webs
11-27-2002, 03:23 AM
Well according to that link I gave above http://archives.hwg.org/hwg-techniques/000501c26d56$adbf36c0$3301e40a@oemcomputer[/url] it's an IE 6 problem. That'll make jkd extremely happy. :)

Neil
(Jason, note the smilie)

Grant Palin
11-27-2002, 04:34 AM
Hmmm, interesting. So does that mean the page only APPEARS that way because I am using Internet Explorer 6? It should otherwise work normally?

Motif Webs
11-27-2002, 04:42 AM
Yep, no horizontal <edit>scroll</edit> in NS 7 at least. However, you have to take into consideration that 80+% of users will be arriving with IE in tow. :)

Neil

jkd
11-27-2002, 06:15 AM
Originally posted by Motif Webs
Well according to that link I gave above http://archives.hwg.org/hwg-techniques/000501c26d56$adbf36c0$3301e40a@oemcomputer[/url] it's an IE 6 problem. That'll make jkd extremely happy. :)

Neil
(Jason, note the smilie)

I'd be happier if IE didn't have the problem at all. ;)

Motif Webs
11-27-2002, 10:01 AM
Originally posted by jkd


I'd be happier if IE didn't have the problem at all. ;) Wouldn't we all. :rolleyes:

Neil

Grant Palin
11-27-2002, 09:48 PM
I'd be happy if all browsers were created equal, and standards compliant!!

jkd
11-28-2002, 01:13 AM
Originally posted by Grant Palin
I'd be happy if all browsers were created equal, and standards compliant!!

Most are. Mozilla, Opera 7, Konqueror 3, IE5/Mac. Everything except IE/Win basically.

Grant Palin
11-28-2002, 04:07 AM
Originally posted by jkd


Most are. Mozilla, Opera 7, Konqueror 3, IE5/Mac. Everything except IE/Win basically.

Sigh...What do you think I'm using?

Grant Palin
12-15-2002, 03:07 AM
Why is Internet Explorer for Windows not standards compliant, and Internet Explorer for Mac is? It's the same program, isn't it?

jkd
12-15-2002, 03:11 AM
Originally posted by Grant Palin
Why is Internet Explorer for Windows not standards compliant, and Internet Explorer for Mac is? It's the same program, isn't it?

Actually, they are not at all the same program. Different teams behind them I think.

Grant Palin
12-15-2002, 03:28 AM
Does Microsoft need two different teams to work on the same program for two differne tplatforms? Is that it?

redstormaudio
12-15-2002, 04:13 AM
Originally posted by jkd
Most are. Mozilla, Opera 7, Konqueror 3, IE5/Mac. Everything except IE/Win basically.

Actually none are completely standards compliant. Try playing with CSS2 and you'll see serious issues.

brothercake
12-15-2002, 04:30 AM
Originally posted by Grant Palin
Does Microsoft need two different teams to work on the same program for two differne tplatforms? Is that it?

Yes - it's just not the same game; writing for a mac you're adressing completely different hardware; ie/win also relies on the presence of Windows (filters, activeX ...), where IE/mac can't.

jkd
12-15-2002, 04:36 AM
Originally posted by redstormaudio
Actually none are completely standards compliant. Try playing with CSS2 and you'll see serious issues.

Nothing will ever be completely standards compliant, and I never suggested browsers were.

However, Opera 7 has near complete support of CSS2. Mozilla is only lacking in some of the content generation features (primarily counters). The serious issues you are talking about are with IE, not the other browsers.

I've used CSS2 extensively and am speaking from experience. Mozilla's and Opera 7's support for it are the only implementations I can really use the advanced aspects of CSS2 in.

Grant Palin
12-15-2002, 04:45 AM
Well, why don't Microsoft and Netscape and the other companies make their browsers standards compliant? Then they would save web designers a lot of headaches!

redstormaudio
12-15-2002, 04:55 AM
Glad to hear Opera 7 has such great CSS support, too bad it's still only in beta.

Originally posted by jkd
Nothing will ever be completely standards compliant...
The point of standards is compliance.

If more web designers wrote compliant code the browser makers would be forced to comply. Too often I read about people feeling 'forced' to use IE because it's the only browser that renders their favorite page well. This kind of thing is what perpetuates the situation.

jkd
12-15-2002, 05:01 AM
Originally posted by redstormaudio
If more web designers wrote compliant code the browser makers would be forced to comply. Too often I read about people feeling 'forced' to use IE because it's the only browser that renders their favorite page well. This kind of thing is what perpetuates the situation.

You realize you are preaching to the choir? I'm usually the one to explain why you should write code to standards... :)

brothercake
12-15-2002, 05:38 AM
I can't see microsoft being forced to comply with anything ... their preparedness to abandon standards whenever its convenient for them is rooted in two things:

1 - profit motivation; and
2 - nothing else

I'm sure i've said this before, but I don't believe this problem will go away as long as we stick to the socio-economic logic of market capitalism as it's applied today - because markets are not truly free, the free market is a myth, and hence capitalism becomes a chain instead of a key.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum