Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/409.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用内联块的并排div不工作_Javascript_Html_Css - Fatal编程技术网

Javascript 使用内联块的并排div不工作

Javascript 使用内联块的并排div不工作,javascript,html,css,Javascript,Html,Css,我正在使用此处给出的无线电滑块:。 我想在这个滑块的右侧放置一个下拉列表,我正在使用display:inline block这样做: <div class="wrapper toggle_radio" style="background: #497dd0; display:inline-block;"> <input type="radio" class="toggle_option" id="first_toggle" name="toggle_opti

我正在使用此处给出的无线电滑块:。 我想在这个滑块的右侧放置一个下拉列表,我正在使用
display:inline block
这样做:

    <div class="wrapper toggle_radio" style="background: #497dd0; display:inline-block;">
       <input type="radio" class="toggle_option" id="first_toggle" name="toggle_option">
       <input type="radio" checked class="toggle_option" id="second_toggle" name="toggle_option">
       <input type="radio" class="toggle_option" id="third_toggle" name="toggle_option">
       <label for="first_toggle"><p>All</p></label>
       <label for="second_toggle"><p>Month</p></label>
       <label for="third_toggle"><p>Quarter</p></label>
       <div class="toggle_option_slider"> </div>
     </div>

  <!-- Right side dropdown -->    
     <div class="pull right" style=" margin-left: 100px;, margin-top: 0px; display:inline-block;">
       <select placeholder="Category" ng-model="selectedCategory" class="md-dark" style="min-width: 100px;">
         <option ng-value="category" ng-repeat="category in categories">{{category | capitalize}}</option>
       </select>
     </div>

全部

四分之一

{{类别|大写}}
但是,未正确对齐(它们位于不同的垂直位置):

有什么快速解决方法吗?

把它放在一张桌子上

应该可以很好地工作,但是您可能需要做一些小的调整(例如增加td的大小),因为我自己还没有测试代码。告诉我进展如何,如果需要帮助。

检查是否: 元素是否浮动。 确保它们的总高度(线条高度、填充和边距)相等。 使用: 垂直对齐:中间对齐

如果使用浮动,垂直对齐将不会对浮动图元产生任何影响。作为显示:如果您是浮动元素,则内联块不可用

<!-- Right side dropdown -->    
 <div class="pull right" style=" margin-left: 100px;, margin-top: 0px; 


你在使用Twitter引导吗?@AbhashUpadhyaya在他的例子中没有引导类。不,我使用的是角度材质tried应用垂直对齐:中间;对两个元素进行垂直对齐。谢谢
<style>
    .row{
        position:relative;
        display:block;
    }
    .column{
        display:inline-block;
        width:49%;
    }
</style>

<div class="row">
    <div class="column">this is left column</div>
    <div class="column">this is right column</div>
</div>