我有一张桌子,当我在Firefox或chrome中加载页面时,它从屏幕上移到了右边,导致大部分桌子消失了,桌子应该位于屏幕中间,并且似乎在右边重叠了在页面区域之外。

<html lang="en">

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Small North Run</title>
<meta name="description" content=" ">
<meta name="keywords" content=" ">
<link rel="stylesheet" href="default.css" type="text/css">
<link rel="stylesheet" href="sponsor.css" type="text/css">

</head>

<body>

<div id="wrapper">

<header>
    <h1>SMALL NORTH RUN</h1>
</header>

<nav>
<ul id="navlist">
    <li><a href="./">HOME</a></li>
    <li><a href="training">TRAINING REGIME</a></li>
    <li><a href="./forum">FORUM</a></li>
    <li><a href="./sponsor.php">SPONSOR</a></li>
    <li><a href="./contact.php">CONTACT</a></li>
</ul>
</nav>
<hr id="hrnav" />

<div id="content">

<p>This page allows you to sponsor a particular runner. Just simply select the name of the runner you wish to sponsor from the drop down list, then enter the amount you wish to donate followed by a brief message for the runner and then your name. Once making a donation the runner you have sponsored will be notified by email that you have made a donation.</p>
<br/>
<br/>
<br/>
<br/>
<form method="post" action="test.php">
<table>

    <tr><td><label>Runner:</label></td>
    <td>
    <select name="fullname">
    <?php do{?>
    <option value="<?php echo $rsNames['user_ID']; ?>"> <?php echo $rsNames['first_Name'];?> <?php echo $rsNames['last_Name'];?></option>
    <?php } while ( $rsNames= mysql_fetch_assoc($names_query))?>
    </select>
    </td>
    </tr>
    <tr><td><label>Donation (£):</label></td><td><input type="text" maxlength="9" value="0.00" name="donation"/></td></tr>
    <tr>
    <td>
        <label>Message:</label>
    </td>
    <td>
        <textarea  name="donationmessage" maxlength="200" cols="25" rows="6"> </textarea>
    </td>
    </tr>
        </tr>
    <tr><td><label>Your Name:</label></td><td><input type="text" maxlength="30"  name="donator"/></td></tr>
    <tr>
    <td>
    <tr><td><input id="submit" type="submit" value="Confirm Donation"/></td></tr>
    </table>
</form>


</div>



</div> <!-- END WRAPPER -->

</body>

</html>

CSS
#content { text-align: left; margin: 2px; padding: 10px; }

#content p { font: font: 12px/1.5 Verdana, sans-serif; float: left; }

最佳答案

尝试添加一个doctype:

例如,这是HTML5文档类型

<!DOCTYPE html>

关于html - 表格在Firefox和Chrome中消失了,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10449535/

10-12 20:49