gpt4 book ai didi

html - 如何对齐我的 HTML 页面组件?

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

我希望我的页面输出如下: enter image description here

但结果却是这样的: enter image description here

你能建议我做什么?代码是模板和CSS:

BODY {background-image: url(/welcome/static/images/register_top2.png); background-repeat: repeat-x; }
#content {
width: 700px ;
margin: 180 auto;

}
#content-container {
width: 700px ;
margin-left: 180px;
}
#image-logo {
float: right;
}
.has_errors { border: 1px solid #ff0000 }
.errors {color: #ff0000;}

<!DOCTYPE hml>
<html>
<head> <link rel="stylesheet" href="/welcome/static/css/register.css"/>

<STYLE TYPE="text/css">



</STYLE>


<title>{% trans %}Register new distributor{% endtrans %}</title> <script type="text/javascript" src="/welcome/static/js/jquery-1.7.1.js"></script>

<script type="text/javascript" src="/welcome/static/js/jquery.popupWindow.js"></script>
</head>
<body>

<div id="content"><img src="/welcome/static/images/reg-reg3.gif">
<div id="content-container">







<form action="{{action}}" method="post">

<table><tr><td>

<label>{% trans %}Soc security number{% endtrans %}</label></td><td>{{ form.soc_sec(size='10', maxlength='10')}}({% trans %}YYMMDDXXXX{% endtrans %})</td></tr>

{% if form.soc_sec.errors %}<tr><td></td><td> <div class="red">
<ul class="errors">{% for error in form.soc_sec.errors %}<li>{{ error }}</li>{% endfor %}</ul></div></td></tr>
{% endif %}

<tr><td>

<label for="start">{% trans %}Your sponsor's ID{% endtrans %}</label></td><td>

<input id="log1" {% if form.sponsor_id.errors %}class="has_errors "{% endif %} maxlength="3" name="sponsor_id-log1" size="3" type="text" value="{% if form.sponsor_id.log1.data %}{{form.sponsor_id.log1.data}}{% endif %}" />

<input id="log2" {% if form.sponsor_id.errors %}class="has_errors "{% endif %} maxlength="3" name="sponsor_id-log2" size="3" type="text" value="{% if form.sponsor_id.log2.data %}{{form.sponsor_id.log2.data}}{% endif %}" />
<input id="log3" {% if form.sponsor_id.errors %}class="has_errors "{% endif %} maxlength="3" name="sponsor_id-log3" size="3" type="text" value="{% if form.sponsor_id.log3.data %}{{form.sponsor_id.log3.data}}{% endif %}" />
<input id="log4" {% if form.sponsor_id.errors %}class="has_errors "{% endif %} maxlength="3" name="sponsor_id-log4" size="3" type="text" value="{% if form.sponsor_id.log4.data %}{{form.sponsor_id.log4.data}}{% endif %}" />

(<a class="open_dialog" href="/static/sponsor-id.html">{% trans %}What is a sponsor ID{% endtrans %}?</a>)</td><td></tr>


{% if form.sponsor_id.log1.errors %}


<tr><td></td><td> <div class="red">
<ul class="errors">{% for error in form.sponsor_id.log1.errors %}<li>{{ error }}</li>{% endfor %}</ul></div></td></tr>
{% endif %}

<tr><td>
<label>Email</label></td><td> {{ form.email(size='22', maxlength='60')}} </td></tr>

{% if form.email.errors %}<tr><td></td><td> <div class="red">
<ul class="errors">{% for error in form.email.errors %}<li>{{ error }}</li>{% endfor %}</ul></div></td></tr>
{% endif %}



<tr><td>
<label>{% trans %}First name{% endtrans %}</label></td><td>{{ form.firstname(size='22', maxlength='60')}}</td></tr>

{% if form.firstname.errors %}<tr><td></td><td> <div class="red">
<ul class="errors">{% for error in form.firstname.errors %}<li>{{ error }}</li>{% endfor %}</ul></div></td></tr>
{% endif %}

<tr><td>
<label>{% trans %}Last name{% endtrans %}</label></td><td>{{ form.lastname(size='22', maxlength='60')}}</td></tr>

{% if form.lastname.errors %}<tr><td></td><td> <div class="red">
<ul class="errors">{% for error in form.lastname.errors %}<li>{{ error }}</li>{% endfor %}</ul></div></td></tr>
{% endif %}

<tr>
<td>
<label>{% trans %}Address{% endtrans %}</label></td><td>{{ form.address(size='22', maxlength='60')}}</td></tr>

{% if form.address.errors %}<tr><td></td><td> <div class="red">
<ul class="errors">{% for error in form.address.errors %}<li>{{ error }}</li>{% endfor %}</ul></div></td></tr>
{% endif %}

<tr><td>
<label>{% trans %}Zip code{% endtrans %}</label></td><td>{{ form.zipcode(size='22', maxlength='60')}}</td></tr>

{% if form.zipcode.errors %}<tr><td></td><td> <div class="red">
<ul class="errors">{% for error in form.zipcode.errors %}<li>{{ error }}</li>{% endfor %}</ul></div></td></tr>
{% endif %}

<tr><td>
<label>{% trans %}City{% endtrans %}</label></td><td>{{ form.city(size='22', maxlength='60')}}</td></tr>

{% if form.city.errors %}<tr><td></td><td> <div class="red">
<ul class="errors">{% for error in form.city.errors %}<li>{{ error }}</li>{% endfor %}</ul></div></td></tr>
{% endif %}

<tr><td>
<label>{% trans %}Phone{% endtrans %}</label></td><td>{{ form.phone(size='22', maxlength='60')}}</td></tr>

{% if form.phone.errors %}<tr><td></td><td> <div class="red">
<ul class="errors">{% for error in form.phone.errors %}<li>{{ error }}</li>{% endfor %}</ul></div></td></tr>
{% endif %}

</table>


<button>{% trans %}Next{% endtrans %}</button>
</form> </div>
<img id="image-logo" src="/welcome/static/images/snabbreg002.jpg" />

</div><script type="text/javascript">
$('.open_dialog').popupWindow({
height:500,
width:700,
top:325,
left:400
});
</script>
</body>
</html>

最佳答案

您是否尝试过添加 background-position: center top

关于html - 如何对齐我的 HTML 页面组件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9441198/

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