Jump to content

what DOC TYPE should I use?


newbeee

Recommended Posts

I have my page done but it does not show the same in FireFox and Internet Explorer, do i need to use a special DOC TYPE to get the same look in both?

 

if so what one should i use?

 

<html>
<head>
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse">
  <tr> 
    <td width="68" height="1"><img src="images/spacer.gif" alt="" width="68" height="1" border="0"></td>
    <td width="146" height="1"><img src="images/spacer.gif" alt="" width="109" height="1" border="0"></td>
    <td width="137" height="1"><img src="images/spacer.gif" alt="" width="113" height="1" border="0"></td>
    <td width="481" height="1"><img src="images/spacer.gif" alt="" width="282" height="1" border="0"></td>
    <td height="1"><img src="images/spacer.gif" alt="" width="68" height="1" border="0"></td>
  </tr>
  <tr> 
    <td rowspan="2" colspan="3" height="91" bgcolor="#FDA005" background="images/bluelinebot.gif"><img src="images/logo-new.jpg" alt="" height="91" border="0"></td>
    <td colspan="2" bgcolor="#FDA005" valign="top" height="84"> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="100%" id="AutoNumber4" height="1">
        <tr> 
          <td width="5%" style="border-style: none; border-width: medium" height="51"> </td>
          <td style="border-style: none; border-width: medium" height="51" nowrap> </td>
        </tr>
        <tr> 
          <td width="5%" style="border-style: none; border-width: medium" height="1"> 
          </td>
          <td width="95%" style="border-style: none; border-width: medium" height="1"> </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td bgcolor="#FDA005" height="7" background="images/blueline.gif"><img src="images/index_r2_c3.gif" alt="" name="index_r2_c3" width="282" height="7" border="0"></td>
    <td rowspan="2" bgcolor="#FFFFFF" height="41" align="right" valign="top" background="images/orangelinetop.gif"> 
      <img src="images/index_r2_c4.gif" alt="" name="index_r2_c4" height="41" border="0" align="right"></td>
  </tr>
  <tr> 
    <td height="34" align="left" valign="top" bgcolor="#FFFFFF"><img src="images/index_r3_c1.gif" alt="" name="index_r3_c1" width="68" height="34" border="0"></td>
    <td colspan="3" bgcolor="#FFFFFF" valign="top" height="34"> 
      <p style="margin-bottom: -11"> </p>
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#9CC2EB" width="100%" id="AutoNumber2">
<tr>
<td width="16%" background="images/img02.jpg" class="topnavright" bgcolor="#2B60AA" align="center"><a href="" class="topmenulink">Home</a></td>
<td width="16%" background="images/img02.jpg"  class="topnavmid" bgcolor="#2B60AA" align="center"><a href="" class="topmenulink">Product Search</a></td>
<td width="16%" background="images/img02.jpg"  class="topnavmid" bgcolor="#2B60AA" align="center"><a href="" class="topmenulink">Manufacturer</a></td>
<td width="16%" background="images/img02.jpg"  class="topnavmid" bgcolor="#2B60AA" align="center"><a href="" class="topmenulink">Help</a></td>
<td width="16%" background="images/img02.jpg"  class="topnavleft" bgcolor="#2B60AA" align="center"><a href="" class="topmenulink">Contact</a></td>
</tr>
</table>
</td>
  </tr>
  <tr> 
    <td colspan="5" bgcolor="#FFFFFF" valign="top"> 
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="100%" id="AutoNumber1">
        <tr> 
          <td width="100%" valign="top" style="border-style: none; border-width: medium"><!-- start --><p align="center" style="margin-left: 4; margin-right: 4; margin-bottom:9">
              <table width="100%" align="center" border="0" cellpadding="10">
  <tr> 
    <td colspan="3"><img src="images/welcome.jpg" alt=""></td>
  </tr>
  <tr> 
    <td><img src="images/lorry.jpg" alt="" width="250" height="165"></td>
    <td rowspan="2" valign="top" style="line-height:23px;"><div align="justify"></div></td>
    <td><img src="images/yard.jpg" alt=""></td>
  </tr>
  <tr> 
    <td><a href=""><img src="images/contact.jpg" alt="" width="250" height="165" border="0"></a></td>
    <td><img src="images/yard2.jpg" alt="" width="250" height="165"></td>
  </tr>
  <tr> 
                <td colspan="3" align="center"> </td>
  </tr>
</table>            </p><!-- end --></td>
        </tr>
        <tr> 
          <td width="100%" style="border-style: none; border-width: medium"> </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td colspan="5" bgcolor="#FFFFFF" valign="top" height="16">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="100%" id="AutoNumber3">
        <tr> 
          <td width="25%" style="border-style: none; border-width: medium" align="center">
	  <a href="index.php" style="text-decoration: none"><b><font face="Verdana" size="2" color="#2B60AA">Home</font></b></a></td>
          <td width="25%" style="border-style: none; border-width: medium" align="center">
	  <a href="" style="text-decoration: none"><b><font face="Verdana" size="2" color="#2B60AA">Map</font></b></a></td>
          <td width="25%" style="border-style: none; border-width: medium" align="center">
	  <a href="" style="text-decoration: none"><b><font face="Verdana" size="2" color="#2B60AA">Contact Us</font></b></a></td>
          <td width="25%" style="border-style: none; border-width: medium" align="center">
	  <p dir="ltr"><a href="" style="text-decoration: none"><b><font face="Verdana" size="2" color="#2B60AA">Product Search</font></b></a></td>
        </tr>
        <tr> 
          <td width="25%" style="border-style: none; border-width: medium" align="center"> </td>
          <td width="25%" style="border-style: none; border-width: medium" align="center"> </td>
          <td width="25%" style="border-style: none; border-width: medium" align="center"> </td>
          <td width="25%" style="border-style: none; border-width: medium" align="center"> </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td colspan="5" bgcolor="#9CC2EB" valign="top" height="8"></td>
  </tr>
  <tr bgcolor="#FDA005"> 
    <td colspan="5" valign="top" height="26"> 
      <p align="center" style="margin-top: 7; margin-bottom: 7"> </td>
  </tr>
</table>
</body>
</html>

Link to comment
Share on other sites

You should add ANY doctype declaration for a start. None doctype however will make your site look the same in all browsers. There's much more to it.

 

http://www.w3.org/QA/Tips/Doctype

 

i used the following DOC TYPE

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

 

 

and the header went all over the place it is now messed up.

and the border line at the bottom of the page in firefox do not show up in IE

Link to comment
Share on other sites

You should use HTML 4.01 Strict. If you use an XHTML doctype then you should serve it as application/xhtml+xml, which does not work with Internet Explorer. If you serve it as text/html then the browser will not render it as XHTML, but HTML. Moreover, the draconian error handling used in XHTML isn't very user friendly either. HTML will try to render, but XML stops at the slightest syntax error.

Link to comment
Share on other sites

A doctype isn't going to make your site render exactly the same in all browsers.  Internet Explorer will always mess up when it renders your site, you just have to learn the "hacks" to make it look like it does in all the other browser.  I use XHTML Transitional:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.