我无法让垂直div
正确排列。似乎有一些东西压低了div
的第一列。这是jsfiddle:
问题出在模态弹出窗口中,因此只需单击“详细信息”按钮即可启动模式对话框。
为什么第一列从顶部被推下?我很想把它全部放在一张桌子上并完成它。
答案 0 :(得分:1)
在div阶段,电压,电流
中使用vertical-align:top<div class="container">
<div class="navbar navbar-default">
<div class="navbar-header">
<a class="navbar-brand" href="#">Bootstrap 3</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown active">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Getting started <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="http://getbootstrap.com/getting-started/#download">Download Bootstrap</a></li>
<li class="divider"></li>
<li class="dropdown-header">Examples</li>
<li><a href="http://getbootstrap.com/getting-started/#template">Basic template</a></li>
<li><a href="http://getbootstrap.com/examples/starter-template/">Starter template</a></li>
<li><a href="http://getbootstrap.com/examples/grid/">Grids</a></li>
<li><a href="http://getbootstrap.com/examples/jumbotron/">Jumbotron</a></li>
<li><a href="http://getbootstrap.com/examples/navbar/">Navbar</a></li>
<li><a href="http://getbootstrap.com/examples/signin/">Sign-in page</a></li>
<li><a href="http://getbootstrap.com/examples/sticky-footer/">Sticky footer</a></li>
<li><a href="http://getbootstrap.com/examples/offcanvas/">Offcanvas</a></li>
<li><a href="http://getbootstrap.com/examples/carousel/">Carousel</a></li>
<li><a href="http://getbootstrap.com/examples/theme/">Theme</a></li>
<li class="divider"></li>
<li class="dropdown-header">Compatibility</li>
<li><a href="http://getbootstrap.com/getting-started/#migration">Migrating from 2.x to 3.0</a></li>
<li><a href="http://getbootstrap.com/getting-started/#browsers">Browser support</a></li>
<li><a href="http://getbootstrap.com/getting-started/#third-parties">Third party support</a></li>
</ul>
</li>
<li><a href="http://getbootstrap.com/css">CSS</a></li>
<li><a href="http://getbootstrap.com/components">Components</a></li>
<li><a href="http://getbootstrap.com/javascript">JavaScript</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="http://getbootstrap.com/customize">Customize</a></li>
</ul>
</div>
</div>
<div class="row text-center">
<a class="btn btn-lg btn-success" data-toggle="modal" data-target="#basicModal">Details</a>
</div>
<div class="modal fade" id="basicModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="motor-1">Power Details</h4>
</div>
<div class="modal-body">
<div id="ipac-details">
<div style="width:100%;text-align:center;">
<div id="phase" style="float:none;display:inline-block; vertical-align:top;">
<div style="border:solid 1px red;"><h2>Phase</h2></div>
<div style="border:solid 1px red;height:131px;"><h2>A</h2></div>
<div style="border:solid 1px red;height:131px;"><h2>B</h2></div>
<div style="border:solid 1px red;height:131px;"><h2>C</h2></div>
<div style="border:solid 1px red;height:239px;"><h2>Angles</h2></div>
</div>
<div id="voltage" style="float:none;display:inline-block;vertical-align:top;">
<div style="border:solid 1px red;"><h2>Voltage</h2></div>
<div style="border:solid 1px red;" id="voltage-a-gauge"></div>
<div style="border:solid 1px red;" id="voltage-b-gauge"></div>
<div style="border:solid 1px red;" id="voltage-c-gauge"></div>
<div style="border:solid 1px red;" id="voltage-phase-gauge"></div>
</div>
<div id="current" style="float:none;display:inline-block;vertical-align:top;">
<div style="border:solid 1px red;"><h2>Current</h2></div>
<div style="border:solid 1px red;" id="current-a-gauge"></div>
<div style="border:solid 1px red;" id="current-b-gauge"></div>
<div style="border:solid 1px red;" id="current-c-gauge"></div>
<div style="border:solid 1px red;" id="current-phase-gauge"></div>
</div>
</div>
<div class="btn-group">
<div class="btn-group">
<button class="btn btn-primary btn-collapse collapsed" type="button" data-toggle="collapse" data-target="#harmonic-analysis" aria-expanded="false" aria-controls="#harmonic-analysis">
Harmonic Analysis
</button>
</div>
<div class="btn-group">
<button class="btn btn-primary btn-collapse collapsed" type="button" data-toggle="collapse" data-target="#pf-analysis" aria-expanded="false" aria-controls="#pf-analysis">
Power Factor Analysis
</button>
</div>
</div>
<div class="collapse" id="harmonic-analysis">
<div class="well">
Harmonic Analysis details go here.
</div>
</div>
<div class="collapse" id="pf-analysis">
<div class="well">
PF details go here.
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
答案 1 :(得分:0)
您可以使用float: left;
来对齐<div id="phase">