0

我创建了一个带有一些文本和图像的 html 页面。我想将文本对齐在我的页面中。它是我所有的 html 源代码:

<!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

4

1 回答 1

1

尝试使用“浮动:左;” 在

<span style="float: left;width:400px;margin:0px 10px 0px 10px;">
于 2013-10-17T23:14:25.433 回答