gpt4 book ai didi

html - p 标签上的对齐文本

转载 作者:太空宇宙 更新时间:2023-11-04 14:27:28 24 4
gpt4 key购买 nike

我创建了一个包含一些文本和图像的 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

最佳答案

尝试使用“float: left;”在

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

关于html - p 标签上的对齐文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19438816/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com