gpt4 book ai didi

javascript - 应用 border-left 时 Css3 html5 Div 对齐中的意外问题

转载 作者:行者123 更新时间:2023-11-28 17:47:50 25 4
gpt4 key购买 nike

我正在尝试使用 html5 和 css3 生成报告,但我遇到了意外行为。我需要的是理解为什么 div 没有对齐

CSS3

.lineDiv{ border-left: 5px solid #FF0000; background:whitesmoke;height:30px; margin-top: 10px; }
/* */
.titleDiv {border-bottom:5px solid OrangeRed;border-top: 4px solid #FFFFFF; text-align: center; ;background:gainsboro;height: 50px; font-size: 18px;color:#2F4F4F ; font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif; font-weight:bold; text-shadow: 1px 1px white;}

.mainDiv{
margin: auto;height: 600px;width: 600px; border: 1px solid gray; }
.bodyDiv
{
margin: 10%;
align-content: center;

}
.labelP
{ float: left; margin-top: 7px;width: 80px; border-right: 1px solid white;vertical-align: middle;
text-align:left; font-size: 15px;color:#2F4F4F ; font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif; font-weight:bold; text-shadow: 1px 1px white;
}
.labelTxt
{display: inline-block; ; margin-top: 7px;width: 80px; vertical-align: middle;width:auto;
text-align:left; font-size: 15px;color:#2F4F4F ; font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif; text-shadow: 1px 1px white;
}


.sectionDiv {border-right:5px solid OrangeRed;border-left:5px solid OrangeRed; text-align: center; ;background:gainsboro;height: 24px; font-size: 16px;color:#2F4F4F ; font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif; font-weight:bold; text-shadow: 1px 1px white; margin-bottom: 5px;}

HTML5

<html>
<head>
<title>Job Alert</title>
</head>

<body>
<!-- Start your code here -->
<div class="mainDiv">
<div class="titleDiv"><p>Unexpected result detected</p></div>
<!-- Body Div-->

<div class="bodyDiv">
<div class="sectionDiv">Job Information</div>

<div class="lineDiv"><span class="labelP">Name&nbsp;&nbsp; </span><span class="labelTxt">&nbsp;GUI TEST </span><div>

<div class="lineDiv"><span class="labelP">JID&nbsp;&nbsp; </span><span class="labelTxt">12345 </span><div>
<div class="lineDiv"><span class="labelP">JID&nbsp;&nbsp; </span><span class="labelTxt">12345 </span><div>


</div>
</div>



</div></div></div></div></div></div></body>

结果 以下是永久链接http://liveweave.com/z25PTh在liveweave上

那么为什么 div 没有对齐?谁能解释或优化这段代码?

最佳答案

你还没有关闭你的 div block ,关闭 div block ...

<div class="lineDiv"><span class="labelP">Name&nbsp;&nbsp; </span><span class="labelTxt">&nbsp;GUI TEST  </span>**<div> <-------   </div>**

<div class="lineDiv"><span class="labelP">JID&nbsp;&nbsp; </span><span class="labelTxt">12345 </span>**<div> <------- </div>**

关于javascript - 应用 border-left 时 Css3 html5 Div 对齐中的意外问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22907662/

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