Doctypes and images side by side

  • XOXO
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Apr 06, 2005
  • Posts: 180
  • Status: Offline

Post September 19th, 2005, 11:41 am

Hi,

I have inserted two images in a td using two img tags side by side without any spaces between the two img tags.

When using the Doctype html 4 transitional loose, everything is fine. However if i want to replace the Doctype with html 4 strict and/or html 4.01 transitional loose and strict then the two images disappear.

Now, I would like to know what to do to make it work when using all doctypes.

doctypes for your convenience:
Code: [ Download ] [ Select ]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">



here it is the code:

Code: [ Download ] [ Select ]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD>
<TITLE>Doctypes</TITLE>
<style type="text/css">
body {background-color:silver}
</style>

</head>
<BODY>

   <TABLE  width="286px" border="1" >  
    
    <TR>
     <TD rowSpan=2 bgcolor="cyan">
            
            <IMG border="0" height="52px" width="150px" alt="blabla"
      src="images\*.gif" ><IMG height="52px" width="36px"
         alt="blablabla"    src="images\**.gif"></TD> 

    <TD width="100px" height="26px">bla</TD>
     
</TR><TR>
    
<TD width="100px" height="26px">bla</TD>

     
</TR>
    </TBODY></TABLE></body></html>
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <HTML><HEAD>
  3. <TITLE>Doctypes</TITLE>
  4. <style type="text/css">
  5. body {background-color:silver}
  6. </style>
  7. </head>
  8. <BODY>
  9.    <TABLE  width="286px" border="1" >  
  10.     
  11.     <TR>
  12.      <TD rowSpan=2 bgcolor="cyan">
  13.             
  14.             <IMG border="0" height="52px" width="150px" alt="blabla"
  15.       src="images\*.gif" ><IMG height="52px" width="36px"
  16.          alt="blablabla"    src="images\**.gif"></TD> 
  17.     <TD width="100px" height="26px">bla</TD>
  18.      
  19. </TR><TR>
  20.     
  21. <TD width="100px" height="26px">bla</TD>
  22.      
  23. </TR>
  24.     </TBODY></TABLE></body></html>

thanks for your input.


[edited]
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 19th, 2005, 11:41 am

  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1397
  • Loc: 55° N, 3° W
  • Status: Offline

Post September 19th, 2005, 12:07 pm

I have not looked in to your problem in depth ...

But, one thing first off is the doctype you are using in your example ... it
is faulty.

It goes like this:

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


the quotation mark I have highlighted is required.
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1397
  • Loc: 55° N, 3° W
  • Status: Offline

Post September 19th, 2005, 12:14 pm

Also use the 4.01 spec.



edit:


You can put any old nonsense in your doctype (for arguments sake) and
it should make no difference at all to the page apart from maybe
changing rendering mode.

The images vanishing must be an unrelated problem. Something else you
are doing.
  • XOXO
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Apr 06, 2005
  • Posts: 180
  • Status: Offline

Post September 19th, 2005, 12:17 pm

Yes thanks for reminding...actually the one for 4.01 is fine but in my example I have used the html 4 loose which needs the quotation mark. However if you add it, it does not make any difference.
  • XOXO
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Apr 06, 2005
  • Posts: 180
  • Status: Offline

Post September 19th, 2005, 12:22 pm

I swear! I am not doing anything ...lol.. that is the code in there and you could try it and see the differences.
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1397
  • Loc: 55° N, 3° W
  • Status: Offline

Post September 19th, 2005, 12:27 pm

What is actually in the doctype (as per my edit above) does not really
matter as far as the page is concerned.

If I change my own sites doctype to HTML99/banana version 43 it displays
just the same.


All a doctype does is tell the validator which standard to validate your markup
against. The browser manufacturers also made use of it for their
doctype switching process.


Your images are another problem (fingers-crossed, else I will be red-faced).
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1397
  • Loc: 55° N, 3° W
  • Status: Offline

Post September 19th, 2005, 12:29 pm

ok ... I will copy and paste it, and try and replicate the error. :D
  • XOXO
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Apr 06, 2005
  • Posts: 180
  • Status: Offline

Post September 19th, 2005, 12:32 pm

Thanks, Well I am suspecting that is because of the way different doctypes define a table.
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1397
  • Loc: 55° N, 3° W
  • Status: Offline

Post September 19th, 2005, 12:32 pm

They work fine for me.



Your path to the images is bizarre:


images\**.jpg ?
  • XOXO
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Apr 06, 2005
  • Posts: 180
  • Status: Offline

Post September 19th, 2005, 12:33 pm

yes that is just a sample...ignore the path please. oops! how come they do not work for me ...this is strange...are you using fire fox?
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1397
  • Loc: 55° N, 3° W
  • Status: Offline

Post September 19th, 2005, 12:37 pm

Both IE and FireFox.
  • XOXO
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Apr 06, 2005
  • Posts: 180
  • Status: Offline

Post September 19th, 2005, 12:38 pm

Sorry I had to mention that it works in IE not in FF and NS, Opera has a little bit of problem.

[edit]


So it works in both IE and FF for you? which versions?
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1397
  • Loc: 55° N, 3° W
  • Status: Offline

Post September 19th, 2005, 12:51 pm

The latest versions.


When you say the images "disappear" do you mean there is nothing
there at all, or that the image link is broken?
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1397
  • Loc: 55° N, 3° W
  • Status: Offline

Post September 19th, 2005, 1:00 pm

Are you using the "\**" as actual iimage names?


Because that seems to be the problem ... it is as if they are being "commented out" when the 4/strict doctype is being used ... I can
see the problem in FireFox now with those names. I changed them to
actual images on my system so I could see what was happening.

Or if not commented out ... it is certainly causing some kind of confusion in Firefox.
  • XOXO
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Apr 06, 2005
  • Posts: 180
  • Status: Offline

Post September 19th, 2005, 1:14 pm

No I am not using those names for the images. The problem exists wiht the actuall image names. Again I am suspecting that is because of the definitions for the tables in different doctypes. But I even looked at the w3c doctypes but i cannot figure it out.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 19th, 2005, 1:14 pm

Post Information

  • Total Posts in this topic: 30 posts
  • Users browsing this forum: No registered users and 81 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.