473,394 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

css file won't link to xhtml

I am trying to read xhtml spec and use one of its examples about css2 in
xhtml.

The example on the PDF paper with internal styles defenition works just
fine. When I try to use an external file with css defs it just does not work
unless I use <link rel...> in the <header>. However, this is not how the
xhtml examples link style sheets and I would like to know the reason why it
is not working for me.

Here is the html file:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="styles.css" type="text/css"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" href="styles.css" type="text/css" />
<title>Home page.</title>
</head>
<body>
<hehe>this needs to turn green before I go home</hehe>
</body>
</html>

and here is the CSS file:

hehe {
color: red;
font-family: monospace;
font-weight: normal;
}

What is wrong, can someone tell me please?

Jul 24 '05 #1
4 4107
Alexander Bolotnov wrote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <hehe>this needs to turn green before I go home</hehe> What is wrong, can someone tell me please?


The Doctype you specified doesn't include a "hehe" element.

What content type are you serving the file with?

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 24 '05 #2
On Wed, 20 Apr 2005 21:15:36 +0200, "Alexander Bolotnov"
<do**@yandex.ru> wrote:
I am trying to read xhtml spec and use one of its examples about css2 in
xhtml.
Which XHTML Spec ?
URL ?
The example on the PDF paper Which PDF Paper ?
URL ?
When I try to use an external file with css defs it just does not work
unless I use <link rel...> in the <header>. Do I understand this right ?
The example you quote _is_ working. You have another example that links
to "an external file with css defs" that doesn't work. What does this
broken example look like ?
What is wrong, can someone tell me please?


No - I don't know what is wrong, so I can't tell you why it is not
working.

For me, I have the styles applied and it appears to "work". Give us the
URL of your server and we can look at your example that isn't working.

There is no "hehe" element in XHTML. Use either <span class="hehe" >
and .hehe {} (which works in all HTML versions) Or else use
namespacing, but that's not usually a good idea.

Jul 24 '05 #3
In article <42***********************@authen.white.readfreene ws.net>,
"Alexander Bolotnov" <do**@yandex.ru> wrote:
<?xml-stylesheet href="styles.css" type="text/css"?>


The PI only works for real XML--not text/html.

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 24 '05 #4
"Andy Dingley" <di*****@codesmiths.com> wrote in message
news:gh********************************@4ax.com...
When I try to use an external file with css defs it just does not work
unless I use <link rel...> in the <header>. Do I understand this right ?

The example you quote _is_ working. You have another example that links
to "an external file with css defs" that doesn't work. What does this
broken example look like ?
This example works as long as it has the <link rel=""> to stylesheet in the
header.
There is no "hehe" element in XHTML. Use either <span class="hehe" >
and .hehe {} (which works in all HTML versions) Or else use
namespacing, but that's not usually a good idea.


I kind of figured this out - if I serve the file as xml type from httpd then
it works. If I open it with my brower as an html page. It does not.

Thanks to all.

the papers and specs I am reading some from www.w3c.org
Jul 24 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: mike | last post by:
regards: I use Jtidy (api) to translate a HTML file into a "XHTML file". But The "XHTML file" cannot be identified by nokia 6600. Do I miss something important? Or this is Jtidy's weakness or...
5
by: Zhang Weiwu | last post by:
Hello. I just read a article "rdf in html: approaches" at "http://infomesh.net/2002/rdfinhtml" (guided by google). Looking into the "Embed XML RDF Part II: Embrace Validation" part, there are an...
20
by: Nick | last post by:
Right now I'm using document.write("<script language='javascript' src='jsFile" + i + ".js'></script>"); It works -- I have a lot of data in each file and only want the visitor to have to...
6
by: rony_16 | last post by:
Hi, I have problem with downloading a file using WebRequest and HttpWebResponse. Inorder to download this file i need to call to url that tells to prepare the file for download, and then i call...
38
by: Neo Geshel | last post by:
I am seeking a method to load one JS file directly into another, *without* having to dynamically write <scripttags. Is there any method whereby I can call only one external JS file using a ...
4
by: justabeginner | last post by:
First of all, let me say I've had very little training in html and probably know just enough to be dangerous. I designed a website for my alumni association last summer using XHTML Transitional and...
5
by: jimchapuk | last post by:
I just started to learn. I can't get the code in my CSS file to link to my HTML file to produce the web page I want. The code I've used is; <link rel="stylesheet" type="txt/css"...
2
by: BadFeeling | last post by:
Hi all, I have started with css some months ago, and though I'm feeling more and more safe and comfortable, some parts of css still don't make perfect sense to me. Right now I have this...
4
by: z55177 | last post by:
My domain: http://www.esthevision.cz/ This is the cause of my problem. The template is supposed to look somewhat like this: PINK STRIPE http://themebot.com/website-templates/ht... I created an...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.