Forum Moderators: open

Message Too Old, No Replies

XHTML Validation

         

Enigmatic

12:06 am on Apr 16, 2004 (gmt 0)

10+ Year Member



I'm trying to validate my pages to be XHTML 1.0 Transitional with the W3C Markup Validation Service. However, after I validate my pages, two things happen.

#1 - I get a warning from the W3C Service saying the following:

DOCTYPE Override in effect! Any DOCTYPE Declaration in the document has been suppressed and the DOCTYPE for «XHTML 1.0 Transitional» inserted instead. The document will not be Valid until you alter the source file to reflect this new DOCTYPE.

What exactly does this mean? This is what my pages show as of now:

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Law Office of Thomas J. Sisul</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="main.css" />
</head>

Is this wrong?

#2 - I'm using inline frames on my web page and after validation my frames start scrolling left and right, as well as up and down. They didn't do this before. I keep messing with the pixel wide of the frames, but this doesn't seem to make a difference. Any suggestions?

Thanks,

Enigmatic

encyclo

12:11 am on Apr 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Error #1: Are you manually selecting the document type? You should use "detect automatically" in the "Type" field (if you're using the extended interface).

As for the second error, I'm not sure what you mean? Do you mean that, in order to validate, you had to change something which makes your iframes scroll horizontally, or that if you click the back button the iframes have a horizontal scrollbar which wasn't there before? Or something else?

Enigmatic

1:26 am on Apr 16, 2004 (gmt 0)

10+ Year Member



Thanks for your help, I figured out my first question. As for my question concerning the horizontal scrolling, let me clarify.

I had originally completed a site that was HTML 4.01 Transitional compliant. I decided a few days ago to check it in Netscape and noticed it didn't look right. I found out that in order to make a cross-browser compatible web site, I needed to go by XHTML standards. Thus, I validated my pages with the W3C Validation Service to make my site XHTML 1.0 Transitional compliant. After doing so, the iframes on my pages starting showing a horizontal scrollbar, as well as the original vertical scrollbar. The content that the iframe is calling is clearly small enough to fit within the document without having to scroll horizontally, so I don't know why this changed once I made the documents XHTML vs. HTML compliant. Any suggestions? Thanks for your help,

Enigmatic

Enigmatic

1:32 am on Apr 16, 2004 (gmt 0)

10+ Year Member



Forgot to mention. The horizontal scrollbar only appears in IE. However, in Netscape and FireFox I'm now noticing that my CSS file isn't being called. This is really getting weird.

Enigmatic

2:49 am on Apr 16, 2004 (gmt 0)

10+ Year Member



I was able to figure out my horizontal scrollbar problem. Apparently IE has decided for once to be more finicky than the other browsers and needed the scrolling="yes" attribute to be added to the iframe.

I am still having problems however with my CSS files not getting called properly. This is difficult to explain, but I'll try.

I have a page with two pictures. Within that page I am calling an iframe for each picture using the target attribute. The main page is using an external CSS file and everything works fine, but the CSS file on the iframe's page isn't working. What I don't understand is that I have tried this on another page and the CSS works fine in all browsers I've tested. But this one particular page is using the target attribute, where the others are not.

Basically the problem is an attorney profiles page. When it loads, the first attorney's profile is shown. In order to see the second attorney's profile, you must click on his picture. Then his content loads. For whatever reason the watermark and words I'm using are showing for each lawyer, but I know the CSS isn't being called because the page is showing the default "black text, Times New Roman" when I'm using "white text, Arial". Any suggestions?

By the way it is only a problem in FireFox and Netscape, not IE. As well, it has only been a problem since I've validated my pages using XHTML 1.0 Transitional. Thanks,

Enigmatic

encyclo

5:56 pm on Apr 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you say that the CSS is not being loaded, are you saying that an external CSS file is not loaded when you use Netscape and Firefox? If this is the case, here's why:

When you moved to XHTML, the Mozilla rendering engine (used in Netscape and Firefox) is parsing your document in standards-compliance mode rather than the quirks mode reserved for older documents. You are encountering a MIME-type problem with your CSS file.

This is a server misconfiguration error rather than a CSS problem: files ending in .css should be served with the mime-type

text/css
. However, some servers are incorrectly serving .css files with the mime-type
text/plain
or
text/x-pointplus
. This matters when you're in standards-compliance mode only, and IE is not affected.

The solution? If you have a server running Apache, you can add the following to the root-level .htaccess file:

AddType text/css .css

A better way to fix it is to get hold of your server's administrator (by the throat if required) and tell them to set up their server properly!

Reference: [devedge.netscape.com...]

Enigmatic

6:16 pm on Apr 16, 2004 (gmt 0)

10+ Year Member



Thanks encyclo for the pointer. However, it still isn't working properly. I added the AddType text/css .css as you suggested to my .htaccess document, but it loads just the same in Netscape and FireFox.

Can I show you my .htaccess file, or is that the kind of thing that shouldn't be shared? Also, why is it that my other pages are working properly and I'm just having problems with this page? They are all calling external CSS files the same. Thanks,

Enigmatic