473,386 Members | 1,726 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,386 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 1443
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.