473,395 Members | 1,742 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,395 software developers and data experts.

DTD: XHTML and CSS

I've just taken over a website that somebody else built and I'm trying to tidy it up and sort out a few problems. I've not built a site for a while – and certainly nothing as complicated as this one – and things have moved on a bit, so I am trying to absorb CSS for layout, whereas in the past I used tables.

My first question concerns the DOCTYPE. Reading drhowarddrfine's post about this, I see that the site I've inherited uses a different declaration:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en">
<head> ...

Should I be using the 'strict' version

<?xml version="1.0" encoding="utf-8"?>
<!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>...

recommended by W3C, or will the declarations that came with the website be OK? I've found a few strange activities in IE/Win which I'm slowly sorting out, but I'm wondering to what extent the DTD is responsible.

Thank you.
Jan 25 '07 #1
2 1202
drhowarddrfine
7,435 Expert 4TB
Xhtml version 1.1 is a modular version of xhtml and should never be served as text/html. You are probably doing this so using 1.1 is wrong. Drop back to 1.0.

As stated in the sticky, IE does not know anything about xhtml served as xhtml. So using the xml declaration at the head will only throw it into quirks mode.

Unless you are serving your pages as text/xhtml+xml, the xml declaration does you know good anyway so just remove it. Other than that, your second doctype is the one you should use.
Jan 25 '07 #2
Other than that, your second doctype is the one you should use.
Thank you very much. Now to see what goodies that throws up...

Helen
Jan 25 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Tjerk Wolterink | last post by:
When i open the following xml file in internetexplorer: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE xc:content > <xc:xcontent...
4
by: Collin VanDyck | last post by:
Hello! I'm relatively new to writing DTDs, so be gentle with me :) I'm writing a DTD to validate XML documents that script my product which managed XHTML. I want to use the DTD to enforce...
2
by: jopaki | last post by:
Hello all, I am relatively new to XSLT. I am attempting to transform XML and everyting is cool until I introduce these top lines in the source XML (really XHTML): --------- <?xml...
3
by: gregory | last post by:
1. server side - Content-Type: application/xhtml+xml, file: hello.xml <?xml version="1.0" standalone='no'?> <!DOCTYPE something SYSTEM "http://myserver/hello.dtd"> <something>Hello World...
7
by: Paul Marsh | last post by:
Hello everyone, I am attempting to create a xhtml page that uses a bit of dhtml. The javascript I am using uses document.getElementById('someId').style.someProperty; and is and external script....
4
by: somebody | last post by:
Hello all, I created a function which gets the position of the mouse. This works fine untill I insert a doctype declaration in the file. The properties 'scrollLeft' and 'scrollTop' in IE will...
29
by: The alMIGHTY N | last post by:
I can't figure out why the function below isn't doing anything in IE 6. I pass the id of a table as the "which" variable. When I activate the function, nothing happens. It doesn't return any...
77
by: VK | last post by:
Randy Webb wrote: > VK said the following on 5/2/2006 9:48 AM: > > If you mean "trying to render it" then FF behavior is the same as for > > all other UA's willing to be in use (and not W3C...
28
by: Andy Dingley | last post by:
What specifies the permitted root element(s) for a document ? HTML, SGML, XHTML or XML ? Valid HTML documents need to have a well-known DTD and a doctypedecl in each document like this:...
6
by: Rolf Welskes | last post by:
Hello, if I have for example: <table style="width: 100%; height: 100%;" border="1"> <tr> <td style="width: 100px">k </td> <td style="width: 100px">k </td> </tr>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.