javascript - Unexpected issue in Css3 html5 Div alignement when applying border-left -
i'm trying produce report using html5 , css3 got unexpected behavior. need understand why div not aligned
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 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 </span><span class="labeltxt"> gui test </span><div> <div class="linediv"><span class="labelp">jid </span><span class="labeltxt">12345 </span><div> <div class="linediv"><span class="labelp">jid </span><span class="labeltxt">12345 </span><div> </div> </div> </div></div></div></div></div></div></body>
result following permanent link http://liveweave.com/z25pth on liveweave
so why div not aligned? can explain or optimize code ?
you have not closed div blocks, close div blocks...
<div class="linediv"><span class="labelp">name </span><span class="labeltxt"> gui test </span>**<div> <------- </div>** <div class="linediv"><span class="labelp">jid </span><span class="labeltxt">12345 </span>**<div> <------- </div>**
Comments
Post a Comment