2013-10-17 47 views
0

我用一些文本和图像创建了一个html页面。我想把文字对齐到我的页面中。它是我所有的html源代码:p标签上的对齐文本

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
     <title>Untitled Page</title> 
     <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> 
     <link rel="stylesheet" href="style.css" /> 
     <script src="http://code.jquery.com/jquery-1.9.1.js"></script> 
     <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> 
     <style> 
      body { 
       font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; 
       font-size: 80%; 
      } 
      br { 
       display: block; 
       margin: 0px 10px 0px 10px; 
      } 
     </style> 
    </head> 
    <body> 
     <p style="background: url(header.png) no-repeat #ffffff; width: 438px; height: 29px; margin: 130px auto; margin-bottom: 0px;"> 
     </p> 
     <p style="background: url(bg.png) no-repeat #ffffff; text-align: left; width: 438px; height: 438px; margin: 0px auto;"> 
      <img id="logo" src="1.png" /> 
      <span style="width: 400px; margin: 0px 10px 0px 10px;"> 
      Google Inc.<br /> 
      Copyright &copy; 2006-2013Google Inc. All Rights Reserved. 
      <br /> 
      Portions of this software were licensed from third parties as described at : 
      <a style="margin-left:8px;" href="http://www.google.com/support/chrome/bin/answer.py?answer=100336">http://www.google.com/support/chrome/bin/answer.py?answer=100336</a>. 
      </span> 
      <br /> 
      <span style="float: right; padding: 0px 10px 0px 10px;"><input type="button" value="Download Now" /><input type="button" value="Ok" /></span> 
     </p> 
    </body> 
</html> 

我的第二个P标签上的文本(背景bg)没有对齐。我该如何解决它?看到这个:http://labonline.somee.com/new.htm

+0

你想如何对齐? –

+1

p是为了段落,为什么你把它们当作div /容器进行处理? –

+0

我想他们没有重叠的边界。 –

回答

1

尝试使用“float:left;”在

<span style="float: left;width:400px;margin:0px 10px 0px 10px;">