14 replies [Last post]
KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 15 years 49 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

Last night I started working on making my pages valid XHTML 1.0 Transitional. I applied the doctype and the charset, and fixed all the bleepin' errors. My pages now validate but the CSS isn't being applied properly (or at all, it seems).

Example of how it should look (w/o the doctype)

Example of the problem (with the doctype)

I'm using

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- and -
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

Does anyone have any suggestions? I'm fairly new to this particular side of the doctypes... :roll: (*rimshot*)

Diplomacy is the art of letting someone have your way

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 15 years 49 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

Something's funky...

Okay, I looked at that "broken" page at least 30 times before I posted this... now, all of a sudden it's working. I didn't make any changes. Any ideas what's going on?

I saw it broken on Win2000/ IE6 and XP Home/ IE6

Diplomacy is the art of letting someone have your way

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 10 years 2 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

Doctype issues

Are you absolutely sure that you are using the same contents and design in both examples ? I can see some content in one of them and not in the other. Or is it purely because its broken ?

http//melbourne.ug.php.net

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 10 years 2 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

Doctype issues

I added the Doc type and tested it on my server and it looks ok. Here is the link

PS. I included the CSS in the htm and changed the image links to point to your server. Change it back when you put it on your host.

http//melbourne.ug.php.net

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 15 years 49 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

Doctype issues

The content is different, but that's it, and different content shouldn't affect anything. *shrug* :roll:

Thanks for your help, if I see the issue again I'll be sure to get a screen capture.

Diplomacy is the art of letting someone have your way

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 15 years 49 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

Doctype issues

Okay, I'm confused... I was on my site an hour ago and it was fine. Now, in a different office (same OS, same browser: Win2000, IE6) the CSS isn't being applied (see attachment).

I posted this here because this is the original issue that prompted me to start this thread.

EDIT: Okay, I was wrong- I was using a different version of IE earlier. The site looks fine in NT4/ IE5.5 and Win2000/ IE5.5 and XP Home/IE6, but the CSS isn't applying well in Win2000/IE6 (which is what the attachment is a capture of).

I edited the page and refreshed multiple times to ensure it's not a cache issue.

Any ideas, anyone?

Diplomacy is the art of letting someone have your way

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

Doctype issues

That's more likely to be the browser setup rather than any specific problem - if you go back to that machine, check the settings, see if there's something hiding somewhere that might be blocking it.

Don't quite know why anyone would set a browser up like that though. I recommend trying it on IE6/2k on a different box (if that's possible, or if there's someone that comes here with that setup) to check that...

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

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 15 years 49 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

Doctype issues

Well, I won't be in the office for a few days- but the same problems are now happening on my XP Home/ IE6 at home (the same box in which everything looked fine a day ago).

*scratching head*

Edit: I'll include links for examples.
index.php with no doctype, works fine
menu_complete.php with doctype, broken

Diplomacy is the art of letting someone have your way

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

Doctype issues

Well that's just scary Shock

But it must be accepting some of the CSS - the quip and header works...

If the quip were at the top I'd have said it was choking on the ugly brilliant hack... but it's actually after that, which helps no-one. Hmm.

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

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 15 years 49 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

Doctype issues

Scary indeed and unfortunately random. Sad According to BrowserCam there aren't many systems that my page looks good on, at the moment. :pout: This is pretty frustrating...

Diplomacy is the art of letting someone have your way

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 15 years 49 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

Doctype issues

paCkeTroUTer wrote:
I added the Doc type and tested it on my server and it looks ok. Here is the link

PS. I included the CSS in the htm and changed the image links to point to your server. Change it back when you put it on your host.

Okay, I just noticed this. paCkeTroUTer uploaded the page, with doctype, to his server, and I can see it fine. The same page on my server looks broken. wtf?? I compared source code, and packetrouter is using:

<?xml version="1.0" encoding="iso-8859-1"?>
<!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">

while I'm using

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

Can anyone explain why that would make a difference? I tried using the same code that packet used and received a php parsing error on Line 1- I'm using .php, he used .htm.

Anyone? Class? Bueller? Shock

Diplomacy is the art of letting someone have your way

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

Doctype issues

From W3C:

Quote:
An XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents.

I suggest using<?php print "<?xml blah woof>"; ?> at the start if you're using PHP. Suppose it'll pick up the short php <? syntax and try to parse the content, not a good idea.

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

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 10 years 2 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

Doctype issues

yes as dJomp suggested for php page use this:

<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!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"> 

http//melbourne.ug.php.net

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 15 years 49 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

Thanks

Thanks guys, that's what I was looking for. It's going to take awhile to actually understand what standards and encoding I need to declare.

The tags you guys listed fixed the site in WinXP/ IE6 but I'm still having issues in quite a few other browsers... Starting a new thread

Thanks again

Diplomacy is the art of letting someone have your way

bladexzero
Offline
newbie
houston, tx
Last seen: 19 years 43 weeks ago
houston, tx
Joined: 2003-08-06
Posts: 5
Points: 0

css doctype

sometimes css and doctype dont match, i had a doctype with a menu bar using css and they wouldnt work, when i took out the doctype it worked fine, also it might be that there is a javascript that doesnt function with the doctype,
well, those are just some thoughts :-k