HTML文本确实不合适

时间:2014-09-20 14:36:53

标签: html

所以我最近决定为我的网站下载一个HTML模板,在下载并设置之后它进展顺利,但是文字会发到底部而不是我希望它去的地方,这里有一些截图

http://imgur.com/VU8qDtf - 那个大空盒子是我想要文本去的地方

http://imgur.com/05XfQKk - 这就是文本实际发生的地方

我是HTML新手,所以请原谅我的noobness,但是在遇到这个问题之前我做得很好。

这是文本代码

<center><h2>Updates</h2></center>

<p style="color:white; font-size: 0.8em"> 20 September 2014 - You can now earn gold by working.</p>

<p style="color:white; font-size: 0.8em">20 September 2014 - Username now displays in the navigation pane.</p>

<p style="color:white; font-size: 0.8em">20 September 2014 - Your Stats page now fully functional.</p>

<p style="color:white; font-size: 0.8em">19 September 2014 - Added new registration page with increased security and validation.</p>

<p style="color:white; font-size: 0.8em">19 September 2014 - Removed login box from every page after logging in.</p>

<p style="color:white; font-size: 0.8em">19 September 2014 - Gold now a resource.</p>

<p style="color:white; font-size: 0.8em">19 September 2014 - Incorrect login now displays an error message</p>

<p style="color:white; font-size: 0.8em" >19 September 2014 - Added Rankings, Your Stats   and Earn Gold pages. Not functional at the moment but will be as soon as possible.</p>

<p><a href=\"main.php\">Back to main page</a></p>

这一切都在一个单独的页面上,我将其余的(背景和东西)保存为header.php,如果您需要,请告诉我

整个模板代码

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Free Layout(from Dandon.net)</title>

<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body topmargin="0" bottommargin="0" style="background-color: rgb(0, 0, 0);">
<center>
<table heigh="" cellpadding="0" cellspacing="0" width="800">
<tbody>
<tr>
<td colspan="2" background="images/lbar.png" height="500" width="38"></td>
<td valign="top">
<table cellpadding="0" cellspacing="0" height="631">
<tbody>
<tr>
<td valign="top"><img src="images/banner.jpg"></td>
</tr>
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" height="450">
<tbody>
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td background="images/nav.png" height="17" width="178">
<div style="color:white" align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">Main</font></div>
</td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">&nbsp;&nbsp;<a href="index.php">» Home</a><br>
&nbsp;&nbsp;<a href="stats.php">» Your stats</a><br>
&nbsp;&nbsp;<a href="units.php">» Units</a><br>
&nbsp;&nbsp;<a href="rankings.php">» Rankings</a><br>
&nbsp;&nbsp;<a href="userson.php">» Online players</a><br>
&nbsp;&nbsp;<a href="updates.php">» Updates</a><br>
&nbsp;&nbsp;<a href="logout.php">» Logout</a><br>
</font></td>
</tr>
<tr>
<td background="images/nav.png" height="17" width="178">
<div style="color:white" align="center"><font face="Verdana, Arial, Helvetica, sans-serif"     size="-1">Social</font></div>
</td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">&nbsp;&nbsp;<a href="chat.php">»     Chatroom</a><br>
&nbsp;&nbsp;<a href="url">» Forum</a><br>


</font></td>
</tr>
</tbody>
</table>
</td>
<td background="images/divider.png" width="11"></td>
<td valign="top">
<table cellpadding="0" cellspacing="0" height="460" width="535">
<tbody>
<tr>
<td background="images/content.png" height="17" width="535">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"></font></div>
</td>
</tr>
<tr>
<td valign="top"><font color="#ff9900" face="Verdana, Arial, Helvetica, sans-serif"     size="-1">&nbsp;&nbsp;&nbsp;</font></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="bottom"><img src="images/footer.png"></td>
</tr>
</tbody>
</table>
</td>
<td colspan="2" background="images/rbar.png" height="500" width="38"></td>
</tr>
</tbody>
</table>
</center>
<div style="color:white; font-size: 0.8em; text-align: center; margin-top: 1em; margin-bottom: 1em;">
Design provided by <a href="http://www.freewebtemplates.com/">Free
Web Templates</a> - your source for free website templates<br>
Supported by <a href="http://www.hosting24.com/" target="_blank">Hosting24.com</a>
</div>
</body></html>

1 个答案:

答案 0 :(得分:0)

您应该删除内联样式,添加一些类并使用text-align:center来集中更新Feed。请参阅小提琴:http://jsfiddle.net/hyfwgx5g/4/

编辑:所以这是小提琴:http://jsfiddle.net/hyfwgx5g/6/

我不确定您的更新Feed是在单独的文件中还是您手动将其添加到页面中。我已经在您的代码应该存在的表格单元格中添加了一个类updates-container。只需将其添加到那里,或者就像我说的那样,如果您要导入文件,请使用include标记添加它(例如<?php include 'updates.php';?>)。