Browsers echo XHTML/CSS as text; why?

M

mot12345

I'm new to XHTML and I'm tripping at some basic things in a tutorial at


http://www-128.ibm.com/developerworks/wireless/library/wi-css/?ca=dgr-lnxw01WirelessPages
(see Listing 4: Inline CSS)

My basic question is:
My browsers, Firefox or MS Internet Explorer, display this by just
showing the XHTML text, rather than rendering the XHTML plus CSS. That
is, the browser literally just shows text starting with "<!DOCTYPE HTML
PUBLIC "-//W3C//DTD ...", rather than showing the Web page this text
represents.

What do I do to make the browsers render XHTML properly?

Thanks,
Wolfgang,
Santa Barbara, CA
 
R

Rob McAninch

(e-mail address removed)>:
I'm new to XHTML and I'm tripping at some basic things in a tutorial at


http://www-128.ibm.com/developerworks/wireless/library/wi-css/?ca=dgr-lnxw01WirelessPages
(see Listing 4: Inline CSS)

My basic question is:
My browsers, Firefox or MS Internet Explorer, display this by just
showing the XHTML text, rather than rendering the XHTML plus CSS. That
is, the browser literally just shows text starting with "<!DOCTYPE HTML
PUBLIC "-//W3C//DTD ...", rather than showing the Web page this text
represents.

URL? Does your browser otherwise support CSS? You may have cut and
pasted something wrong.

Of course, as the lesson points out, an external style sheet is
better unless you have a good reason for inline styling.
 
T

trvst2

I'm new to XHTML and I'm tripping at some basic things in a tutorial at


http://www-128.ibm.com/developerworks/wireless/library/wi-css/?ca=dgr-lnxw01WirelessPages
(see Listing 4: Inline CSS)

My basic question is:
My browsers, Firefox or MS Internet Explorer, display this by just
showing the XHTML text, rather than rendering the XHTML plus CSS. That
is, the browser literally just shows text starting with "<!DOCTYPE HTML
PUBLIC "-//W3C//DTD ...", rather than showing the Web page this text
represents.

What do I do to make the browsers render XHTML properly?

Thanks,
Wolfgang,
Santa Barbara, CA


I had the same problem, and my mistake was in how I saved the file.
Make sure you save the file with the .html extension and you save it
as a text file.

trvst2
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top