我正在设计一个网页,其中有一个日期列表出现在另一个下面。我想调整日期,使它们完美地排列在彼此之下。我尝试使用对齐,但它没有任何区别。我也尝试了一个样式标签,但我得到一个错误,说: “元素”风格“不允许作为元素的子元素”div“在这种情况下。”HTML日期显示对齐
这里的页面代码:
<div class="report-title">
<h1>Response Tracking Report</h1>
</div>
<div class="info">
<div style="width:93%;float:left;">
<p class="title">Project: </p>
<p class="value"><?php echo $response_data['project_name']; ?></p>
</div>
<div class="spacer"></div>
<div style="width:7%;float:left;">
<p class="value"><?php echo date("Y-m-d"); ?></p>
</div>
<div class="bottom"></div>
</div>
<div id='response-info' class='info'>
<div style='width:100%;'>
<p class='title'>Risk Statement: </p>
<p id='risk_statement' class='value'><?php echo $response_data['risk_statement']; ?></p>
<br/><br/>
</div>
<div style='width:24%;float:left;'>
<p class='title'>WBS: </p><p class='value'><?php echo $response_data['WBS']; ?></p>
<br/><br/>
<p class='title'>Date of Plan: </p><p class='value' ><?php echo $response_data['date_of_plan']; ?></p>
<br/><br/>
<p class='title'>Last Updated: </p><p class='value' ><?php echo $response_data['date_of_update']; ?></p>
<br/><br/>
<p class='title'>Planned Closure: </p><p class='value' ><?php echo $response_data['planned_closure']; ?></p>
</div>
<div class='spacer' style='width:1%;float:left;height:1px;'></div>
<div style='width:24%;float:left;'>
<p class='title'>Owner: </p><p class='value'><?php echo $response_data['owner']; ?></p>
<br/><br/>
<p class='title'>Cost: </p><p class='value'>$<?php echo round($response_data['cost']); ?></p>
<br/><br/>
<p class='title'>Release Progress: </p><p class='value'><?php echo $response_data['release_progress']; ?></p>
<br/><br/>
<p class='title'>Action: </p><p class='value'><?php echo $response_data['action']; ?></p>
</div>
<div class='spacer' style='width:1%;float:left;height:1px;'></div>
<div style='width:50%;float:left;'>
<p class='title'>Current Status: <br/> </p><p class='value'><?php echo $response_data['current_status']; ?></p>
<br/>
<br/>
<p class='title'>Action Plan: <br/> </p><p class='value'><?php echo $response_data['action_plan']; ?></p>
</div>
<div id='bottom' style='clear:both;width:100%'></div>
</div>
<div id="ResponseUpdateTableContainer" class="jTableContainer" style="width:100%;"></div>
</body>
如何日期当前显示:http://imgur.com/UxbugwX
如何我试图让他们:http://imgur.com/mAgfRYO
我是新来的HTML,以便请原谅我的错误。所有的帮助非常感谢。
如果他们坐在一个div上,你可以使用'float:right',这样他们全都坐在'div'的右边,如果你愿意的话,你可以使用margin来将它推回去想。但既然我们知道div的右边将是一条平坦的线,我们可以根据它排列它们。合理? – Austin 2014-09-10 19:58:11
为什么不使用表格? – 9997 2014-09-10 20:02:23
我尝试过'float:right',但没有正常工作。 http://imgur.com/3nqPjJO – shhasan 2014-09-10 20:05:57