Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to center page in every type of browser --- works in most, not in others
    text
    copied!<p>I've done a very simple html set of pages for this site: <a href="http://www.soilexpress.com/environmental.php" rel="nofollow">http://www.soilexpress.com/environmental.php</a></p> <p>on most devices, it centers correctly within the size of the browser window, with equal margins on either side.</p> <p>I've had some reports of specific problem machines though:</p> <p>On ie10 (large screen laptop) it looked off-center to the right.</p> <p>On iphone 4G (portrait or landscape) the page was off-center to the right.</p> <p>I'm wondering if someone can tell me the device/browser specific lines to put at the top so it will always be centered.</p> <p>I believe the problem comes from my identification (or lack) of the type of document at the top of the page and thinking maybe I should add some If statement at the top to allow for a more strict document type for certain browsers????</p> <p>As it is now, it is merely identified as <code>html</code>. If I change the description to a more detailed type, it changes the centering. </p> <p>I appreciate the help. thanks.</p> <hr> <h2>Here is the text from the example above -- environmental.php</h2> <pre><code>&lt;html&gt; &lt;head&gt;&lt;title&gt;Environmental - SoilExpress&lt;/title&gt; &lt;link rel="shortcut icon" href="/favicon.ico"&gt; &lt;link href='http://fonts.googleapis.com/css?family=Lato:300,900' rel='stylesheet' type='text/css'&gt; &lt;style type="text/css"&gt; &lt;!-- img { border-style: none;} td {color:#ffffff; font-size:15px; font-family: 'Lato', sans-serif; font-weight: 300; } .footer {color:#999999; font-size:12px; font-family: 'Lato', sans-serif; font-weight: 300; } .whiteheader {color:#ffffff; font-size:20px; font-family: 'Lato', sans-serif; font-weight: 300; } .redheaderblower {color:#cc0000; font-size:30px; font-family: 'Lato', sans-serif; float: right; font-weight: 900; } .redheadereow {color:#ff0000; font-size:30px; font-family: 'Lato', sans-serif; float: left; font-weight: 900; } --&gt; &lt;/style&gt; &lt;/head&gt; &lt;body background='/web_images/level3-background.png' marginheight="0" topmargin="0"&gt; &lt;!-- master table --&gt; &lt;table width="100%" cellpadding="0" cellspacing="0" border="0"&gt; &lt;tr&gt;&lt;td width='50%'&gt;&lt;img src='/web_images/trs.gif' height='1' width='1'&gt;&lt;/td&gt; &lt;td valign="top" width="1200"&gt; &lt;!-- content table --&gt; &lt;table width="1200" cellpadding="0" cellspacing="0" border="0"&gt; &lt;tr&gt; &lt;td valign="top" width="1200" colspan='6'&gt; &lt;a href='/'&gt; &lt;img src='/web_images/row-header.png' width='1200' height='120' style='vertical-align: top;'&gt; &lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;!-- ROW navigation --&gt; &lt;tr&gt; &lt;td&gt; &lt;img src='/web_images/row-nav1.png' width='207' height='136' style='vertical-align: top;'&gt; &lt;/td&gt; &lt;td&gt; &lt;a href='/safety.php'&gt; &lt;img src='/web_images/row-nav-safety.png' width='185' height='136' style='vertical-align: top;'&gt; &lt;/a&gt; &lt;/td&gt; &lt;td&gt; &lt;a href='/equipment.php'&gt; &lt;img src='/web_images/row-nav-equipment.png' width='220' height='136' style='vertical-align: top;'&gt; &lt;/a&gt; &lt;/td&gt; &lt;td&gt; &lt;a href='/capable.php'&gt; &lt;img src='/web_images/row-nav-capable.png' width='165' height='136' style='vertical-align: top;'&gt; &lt;/a&gt; &lt;/td&gt; &lt;td&gt; &lt;a href='/environmental.php'&gt; &lt;img src='/web_images/row-nav-environmental.png' width='218' height='136' style='vertical-align: top;'&gt; &lt;/a&gt; &lt;/td&gt; &lt;td&gt; &lt;img src='/web_images/row-nav1.png' width='205' height='136' style='vertical-align: top;'&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="1200" colspan='6'&gt; &lt;img src='/web_images/environmental.png' width='1200' height='750'&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="1200" colspan='6'&gt; &lt;table width='1200' cellspacing='0' cellpadding='0' border='0'&gt; &lt;tr&gt;&lt;td bgcolor='black'&gt; &lt;img src='/web_images/trs.gif' width='381' height='1'&gt; &lt;/td&gt; &lt;td bgcolor='black'&gt; &lt;a href='/contact.php'&gt; &lt;img src='/web_images/footer-contact-link.png' width='123' height='92' style='vertical-align: top;'&gt; &lt;/a&gt; &lt;/td&gt; &lt;td bgcolor='black'&gt; &lt;a href='/'&gt; &lt;img src='/web_images/footer-home-link.png' width='196' height='92' style='vertical-align: top;'&gt; &lt;/a&gt; &lt;/td&gt; &lt;td bgcolor='black'&gt; &lt;img src='/web_images/footer-copyright.png' width='500' height='92' style='vertical-align: top;'&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt;&lt;td width='50%'&gt;&lt;img src='/web_images/trs.gif' height='1' width='1'&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/table&gt; &lt;/body&gt;&lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload