在表单之后页脚不会停留在页面底部

时间:2017-04-17 04:05:11

标签: html css

我的页脚放置在我的联系页面上有问题。在我的网站的每个其他页面上,页脚正确放置在页面的底部,但由于某种原因,页脚位于我的表单上方,甚至覆盖了第一个输入框。有人可以帮助我吗?

以下是我的联系表格的编码:



 footer {
	display: block;
    clear: both;
    font-size: 0.8em;
    height: 50px;
    text-align: center;      
	width:960px;	
	margin: auto;
	position: absolute;
    }

    footer .footer-wrapper {
    margin: 0;
    padding:  3px 20px;
    }

    ul#social li {
    display: inline;
    list-style: none;
    }

    ul#social li a {
        color: #999;
        text-decoration: none;
    }

    a.facebook, a.twitter {
        display: block;
        float: left;
        height: 24px;
        padding-left: 17px;
        text-indent: -9999px;
        width: 16px;
    }

 <section>
    <div>
	<form name="customerForm" method="post" action="?">
		<table cellspacing="3" cellpadding="5" border="0" style="width: 95%;" align="center">
		<tr>
			<td>Name: </td>
			<td><input type="text" name="cusName" size="25" value="<?php echo $fullName; ?>" /></td>
		</tr>
		<tr>
			<td>Email: </td>
			<td><input type="text" name="cusEmail" size="30" value="<?php echo $emailAddress; ?>" /></td>
		</tr>
		<tr>
			<td>Mobile: </td>
			<td><input type="text" name="cusMobile" size="25" value="<?php echo $mobilePhone; ?>" /></td>
		</tr>
		<tr>
			<td>Enquiry: </td>
			<td><textarea name="posting" cols="52" rows="25"><?php echo $posting; ?></textarea></td>
		</tr>
		<tr>
			<td colspan="2"><input type="submit" name="submit" value="Send" />&nbsp;
			<input type="reset" name="reset" value="Clear Form"/></td>
		</tr>
	</form>
	
    </div>
    </section>
  <footer>
            <div class="footer-wrapper">
                <div class="float-left">
                    <p>&copy; My-Com Computers</p>
                </div>
                <div class="float-right">
                    <ul id="social">
                        <li><a href="http://facebook.com" class="facebook">Facebook</a></li>
                        <li><a href="http://twitter.com" class="twitter">Twitter</a></li>
                    </ul>
                </div>
            </div>
        </footer>
    
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:-1)

你错过了表格关闭标记你的html </table>

 <section>
 <div>
 <form name="customerForm" method="post" action="?">
<table cellspacing="3" cellpadding="5" border="0" style="width: 95%;" align="center">
<tr>
    <td>Name: </td>
    <td><input type="text" name="cusName" size="25" value="<?php echo $fullName; ?>" /></td>
</tr>
<tr>
    <td>Email: </td>
    <td><input type="text" name="cusEmail" size="30" value="<?php echo $emailAddress; ?>" /></td>
</tr>
<tr>
    <td>Mobile: </td>
    <td><input type="text" name="cusMobile" size="25" value="<?php echo $mobilePhone; ?>" /></td>
</tr>
<tr>
    <td>Enquiry: </td>
    <td><textarea name="posting" cols="52" rows="25"><?php echo $posting; ?></textarea></td>
</tr>
<tr>
    <td colspan="2"><input type="submit" name="submit" value="Send" />&nbsp;
    <input type="reset" name="reset" value="Clear Form"/></td>
</tr>
</table><!-- new added-->
</form>

</div>
</section>

这是您的输出https://jsfiddle.net/mxmd5jq9/

答案 1 :(得分:-1)

您忘记关闭表标记

<section>
<div>
<form name="customerForm" method="post" action="?">
    <table cellspacing="3" cellpadding="5" border="0" style="width: 95%;" align="center">
    <tr>
        <td>Name: </td>
        <td><input type="text" name="cusName" size="25" value="<?php echo $fullName; ?>" /></td>
    </tr>
    <tr>
        <td>Email: </td>
        <td><input type="text" name="cusEmail" size="30" value="<?php echo $emailAddress; ?>" /></td>
    </tr>
    <tr>
        <td>Mobile: </td>
        <td><input type="text" name="cusMobile" size="25" value="<?php echo $mobilePhone; ?>" /></td>
    </tr>
    <tr>
        <td>Enquiry: </td>
        <td><textarea name="posting" cols="52" rows="25"><?php echo $posting; ?></textarea></td>
    </tr>
    <tr>
        <td colspan="2"><input type="submit" name="submit" value="Send" />&nbsp;
        <input type="reset" name="reset" value="Clear Form"/></td>
    </tr>
    </table>
    </form>
</div>
</section>
相关问题