CSS not visible with XHTML decleration

P

peteraward

I have the following XHTML, and it links to page.css (which does
exist). Before I put in the xml decleration, doctype and html, it
worked. Now, the css is ignored. (FF1507Win98)

Any ideas?

--------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>My Home Page</title>
<link rel="stylesheet" type="text/css" title="Blue and Orange"
href="page.css" />
</head>
<body>
<h1 id="PageTitle"><span>Smarty example website - My Home
Page</span></h1>
<div id="MainText">
Hello Peoples.
</div>

<h1 id="FooterText">This website, it's design, contents, data and
concept are the copyright material of Peter Ward.</h1>

</body>
</html>

-----------------
page.css:

body { overflow: hidden; background-color: #ABCDEF; color: #339900; }
#PageTitle { text-align: center; font-weight: normal; color: #339900;
background-color: #FF9900; border: solid #D5B377 4px; }
#MainText { position: absolute; top: 20%; left: 10%; width: 80%;
padding: 0px; margin: 0px; text-align: center; font-size: 28pt; color:
#339900; background-color: #FEDCBA; border: solid #D4D4D4 4px; }
#FooterText { position: absolute; bottom: 0px; left: 0px; width: 104%;
height: 28px; padding: 0px; margin: 0px; text-align: center; font-size:
14pt; background-color: #000000; color: #FFFFFF; }
 
E

Els

I have the following XHTML, and it links to page.css (which does
exist). Before I put in the xml decleration, doctype and html, it
worked. Now, the css is ignored. (FF1507Win98)

Any ideas?

[snip code]

Please provide an online example that shows this behaviour, so people
don't have to jump through hoops[1] to help you.

____
[1] copy your HTML, paste it in a file, save it, copy your CSS, paste
it in a file, save it, upload two files to a webserver, see what
happens in the browser...
 
A

Andy Dingley

Any ideas?

I think you've posted this far too much for anyone to want to bother
helping you any more.
<plonk>


Here's a clue though:

If you don't understand XHTML, just don't use it.

If you don't understand why XHTML 1.1 isn't usable yet, then you don't
understand XHTML.
 
D

Dan

I have the following XHTML, and it links to page.css (which does
exist). Before I put in the xml decleration, doctype and html, it
worked. Now, the css is ignored. (FF1507Win98)

How about posting your request a few dozen more times? Somebody in
Outer Mongolia might still have failed to notice it.

One possible cause is if your server isn't serving the CSS under the
proper MIME type (text/css); Mozilla browsers will ignore such
stylesheets unless "quirks mode" is active (based on the page doctype).
 
P

peteraward

Except that I have used XHTML 1.1 elsewhere and been able to use CSS
with it in the same way, same browser, and have it actually work.

And I didn't see my message appear within 5 minutes, so I assumed that
Google Groups had got an error in it's coding somewhere, given that it
asked for my password every second page.

It doesn't work with XHTML 1.0 either.

But it does work when no standard decleration is used.
 
J

jojo

Except that I have used XHTML 1.1 elsewhere

Which does not proof that you understand it but the opposite: You do not
know why XHTML 1.1 isn't usable yet...
and been able to use CSS
with it in the same way, same browser, and have it actually work.

Perhaps it worked... but in all browsers? and with the correct MIME-type
for *X*HTML?
And I didn't see my message appear within 5 minutes, so I assumed that
Google Groups had got an error in it's coding somewhere, given that it
asked for my password every second page.

Use a newsreader instead of googlegroups... but just a hint... ;-)
And BTW: please do not "top post", make sure your reply is *below* the
quote! then you can read a post from the top to the bottom instead of
the way round, improves readability... Thank you.
It doesn't work with XHTML 1.0 either.

Why don't you just use HTML?
But it does work when no standard decleration is used.

Perhaps for some reason you need the quirks-mode? does your site
validate? (sorry, I had no time to check it myself..)
 
A

Andy Dingley

Except that I have used XHTML 1.1 elsewhere and been able to use CSS
with it in the same way, same browser, and have it actually work.

Web authors regularly "use" a badly mangled hybrid of HTML 2 and MS
Orifice, and even that manages to "actually work".

The question is, is it _correct_. Of course it merely "works". For
some value of "works", on at least one machine, in one location. If we
hope to make it work worldwide, on a good range of browsers and similar
devices, and to keep working for the forseeable future, then we have to
do better than merely getting it to behave itself long enough to watch
it work just the once. We have to start thinking about objective
standards.
And I didn't see my message appear within 5 minutes, so I assumed that
Google Groups had got an error in it's coding somewhere,

Thankyou for that. So why did you multi-post to different ngs too?

But it does work when no standard decleration is used.

What's a "standard decleration" ?

CSS works with XHTML. Now I know _you're_ infallible (you can even tell
when Google is broken, knowing that you need to re-post your wisdom to
it), but have you not considered for a moment the idea that this stuff
_works_, and that if it didn't, it would have been fixed? Guess what -
_you_ are doing something wrong.

Go and learn how to use XHTML.
Go and learn how to use XHTML on the web (this is currently different)
Go and learn why XHTML 1.1 doesn't work for the web.

If you do all this, and the web is stil broken for you (after all, it
couldn't be your fault), then when you come back remember to post a URL
to the site because we can't diagnose this sort of complex issue from a
short fragment alone.

Don't forget to multi-post your replies too, just in case you catch
Google stop working again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top