我遇到一些問題,我不知道如何解決。與浮動意外對齊:左和浮動:右div元素
的html代碼:
<div id="fileOutput">
<h2><center>DASHBOARD</center></h2>
<div id="tittletextbox1"><img src="images/computer.png" style="vertical-align: middle;"> Basics</div>
<div id="textbox1"></div>
<div id="tittletextbox2"><img src="images/network.png" style="vertical-align: middle;"> Networking</div>
<div id="textbox2"></div>
</div>
文字框中填充了JavaScript對象。
CSS:
div#fileOutput{
margin: auto;
margin-top: 50px;
margin-left: 250px;
margin-right: 50px;
margin-bottom: 50px;
display:block;
overflow:auto;
white-space: pre-line;
border: solid 1px black;
padding: 5px;
}
div#tittletextbox1{
float:left;
width: 40%;
}
div#tittletextbox2{
float:right;
width: 40%;
}
div#textbox1{
float:left;
width: 40%;
border: 1px solid black;
}
div#textbox2{
float:right;
width: 40%;
border: 1px solid black;
}