472,982 Members | 1,172 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

HTML 4.01 versus XHTML1

5
Hey there. I have a problem with some really simple xhtml.
The following will just pile up the text, and ignore any positioning.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html
  2.         PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3.         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" lang="en_EN" xml:lang="en_EN">
  5. <head>
  6. <title>UMDB:Unknown?</title>
  7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  8. <meta name="generator" content="pdftohtml 0.40" />
  9. <meta name="author" content="Andreas Blom" />
  10. <meta name="date" content="2007-11-13T06:12:48+00:00" />
  11. <style type="text/css">
  12. <!--
  13.         .ft0{vertical-align:top;font-size:13px;font-family:Times;color:#000000;letter-spacing:0.00000px;}
  14.         .ft1{vertical-align:top;font-size:16px;font-family:Times;color:#000000;letter-spacing:0.00000px;}
  15. -->
  16. </style>
  17. </head>
  18. <body>
  19. <div style="position:relative;width:892;height:1263;">
  20. <div style="position:absolute;top:58;left:779"><span class="ft0">1</span></div>
  21. <div style="position:absolute;top:111;left:389"><span class="ft1">2007-10-12</span></div>
  22.  
  23. </div>
  24.  
  25. </body>
  26. </html>
  27.  
The following code is the exact same, except for the header. It is now html4. Due to other factors html4 is not really an option , (or it is at least as complicated to solve the html4-problem.)

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <title>UMDB:unknown?</title>
  5. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <style type="text/css">
  7. <!--
  8.         .ft0{vertical-align:top;font-size:13px;font-family:Times;color:#000000;letter-spacing:0.00000px;}
  9.         .ft1{vertical-align:top;font-size:16px;font-family:Times;color:#000000;letter-spacing:0.00000px;}
  10. -->
  11. </style>
  12. </head>
  13. <body>
  14. <div style="position:relative;width:892;height:1263;">
  15. <div style="position:absolute;top:58;left:779"><span class="ft0">1</span></div>
  16. <div style="position:absolute;top:111;left:389"><span class="ft1">2007-10-12</span></div>
  17.  
  18. </div>
  19.  
  20. </body>
  21. </html>
  22.  
Now the html4-version renders correctly in all browers.

BOTH are correct according to http://validator.w3.org but only html4-version works. according to xhtml1 definitions nothing in the code above is wrong. why why why won't it work ?
Feb 26 '08 #1
6 1435
drhowarddrfine
7,435 Expert 4TB
Your doctype does not include the URL so IE goes into quirks mode. The version you use is deprecated. Use this one:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

However, since you were using quirks, this may change what your page looks like.

Why is HTML4.01 not an option? Are you serving your page as XHTML, or only using the doctype? I'd bet that you are serving your xhtml as html.
Feb 27 '08 #2
blompa
5
Hey, I sent you a private message with a few links to compare between.
Feb 27 '08 #3
blompa
5
on a sidenote. all browser (opera, firefox and ie7) displays this in the same way.
Feb 27 '08 #4
blompa
5
I think I may have solved it.

the positioning has no unit type.

apparently this is in accordance with even strict dtd but the browsers don't assume lack of unit type means px should be used.


hmmmm. div style: might need css verification and not xhtml. xhtml-verification just checks the style-element. not its text string. right?
Feb 27 '08 #5
drhowarddrfine
7,435 Expert 4TB
Units are always required in CSS.
The (x)html validator only checks (x)html and never CSS.
Please do not send me PMs. If you have a question about this problem, please post it here so all may learn. This is against forum rules, also.
Feb 27 '08 #6
blompa
5
Units are always required in CSS.
The (x)html validator only checks (x)html and never CSS.
Please do not send me PMs. If you have a question about this problem, please post it here so all may learn. This is against forum rules, also.
Right. no PMs.
Reason for was that I didn't want to openly share those links.
Feb 28 '08 #7

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

Similar topics

1
by: hongping | last post by:
I am having problems transforming a xml doc into html with proper indenting. Here is the xslt <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0"...
4
by: Doug | last post by:
Hi - I'm looking to code some javascript that has an event handler tied to an image ("a down arrow") that will expand code that was hidden on the page load. It's pretty simple, I have an...
10
by: mike | last post by:
regards: Where to find tag mapping-table of HTML translated to XHTML1.0 Any positive suggestion is welcome. thank you May goodness be with you all
20
by: Alan Silver | last post by:
Hello, I have read about the problems that IE has when using a doctype of HTML 4.01 Transitional. I was advised to use Strict wherever possible. My question is, does the same apply to XHTML...
2
by: PapaRandy | last post by:
Hello, I am trying to validate the following .py webpage as HTML (through W3C). I put: ----------------------------------------------------------------------------- print "Content-type:...
1
by: Tatyana | last post by:
Hello, I was wondering if anybody can help to distinguish the difference (for ASP.NET pages) between I've got JavaScript Menu which I have to plug-in to the master page.
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: shaolinman829 | last post by:
My collegue and I are at the point of pulling our hair out. I'm currently writting a little piece of Java code to send an email confirmation page that sends both html and text. Not a problem. In my...
6
by: Aaron Gray | last post by:
Hi, I am working on an HTML WYSISYG Wiki and need to display a diff page like WikiPedia does if two people edit a file at the same time to give the second user the diff. Basically with additions...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.