html - 如何将div移动到屏幕的右侧

标签 html css

我试图将我的 第二个 div 放在页面的右侧

显然第二个 div 应该在第一个 div 的右侧。目前就在第一个 div 下面,我想把它放在第一个 div 的右侧,并且应该保持响应

我试图将我的 第二个 div 放在页面的右侧

显然第二个 div 应该在第一个 div 的右侧。目前就在第一个 div 下面,我想把它放在第一个 div 的右侧,并且应该保持响应

我如何使用 css 完成此操作。

 <div class="container col-md-12 col-md-offset-0">
        <div class="well well bs-component">
        <form class="form-horizontal" method="post">
        {!! csrf_field() !!}

       <--1st div -->
        <div class="form-group">
        <label for="name" class="col-lg-1 control-label">Phone</label>    
        <div class="col-lg-8">
        <input type="text" class="typeahead  form-control" id="phone" placeholder=" Customer Phone Number" name="phone" required>
        </div>
        </div>

        <div class="form-group">
        <label for="name" class="col-lg-1 control-label"> Name</label>
        <div class="col-lg-8">
        <input type="text" class="form-control" id="name" placeholder=" Customer Name" name="name" required>
        </div>
        </div>
        <--End of 1st div -->


       <--2nd div -->
        <div class="panel">
        <div class="panel_1">
        <table class="table">
          <thead>
     <tr> 
      <th>Name</th>
      <th>Country</th>
     </tr>
     </thead>
     </table>                                                                                                                                                          
        </div>
        </div>
       <--End of 2nd div -->



       <--3rd div -->
              <div class="row">
                <div class="col-md-9">

                  <div  class="nav-tabs-custom" id="tabs">

                    <ul class="nav nav-tabs">
                    @foreach($countries as $country)

                       <li><a href="#tab_{{ $country->id }}" data-toggle="tab" >{!!$category->name!!}</a></li>
                       @endforeach


                    </ul>
                    <div class="tab-content">
                    @foreach($countries as $key => $country)

                      <div class="tab-pane" id="tab_{{ $country->id }}">
                      <table class="table" id="tables">
                                        <thead>
                                            <tr> 
                                                <th></th>
                                                <th colspan="5"></th>
                                                <th></th>
                                            </tr>
                                       </thead>
                                       <tbody id="food_list">
                      @foreach($country->teams as $team)
                                         <tr>
                                            </tr>
                      @endforeach       
                   </tbody>
                   </table>
                     </div>
                    @endforeach     
                      </div>    

                    </div>

                  </div>

                </div>
       <--End of 3rd div -->


        </form>
        </div>
        </div>

最佳答案

    <div class="container col-md-12 col-md-offset-0">
    <div class="well well bs-component">
    <form class="form-horizontal" method="post">
    {!! csrf_field() !!}

   <!--1st div --><div class="col-xs-12 col-sm-6">
    <div class="form-group">
    <label for="name" class="col-lg-1 control-label">Phone</label>    
    <div class="col-lg-8">
    <input type="text" class="typeahead  form-control" id="phone" placeholder=" Customer Phone Number" name="phone" required>
    </div>
    </div>

    <div class="form-group">
    <label for="name" class="col-lg-1 control-label"> Name</label>
    <div class="col-lg-8">
    <input type="text" class="form-control" id="name" placeholder=" Customer Name" name="name" required>
    </div>
     </div></div>
    <!--End of 1st div -->


   <!--2nd div --><div class="col-xs-12 col-sm-6">
    <div class="panel">
    <div class="panel_1">
    <table class="table">
      <thead>
 <tr> 
  <th>Name</th>
  <th>Country</th>
 </tr>
 </thead>
 </table>                                                                                                                                                          
    </div>
     </div></div>
   <!--End of 2nd div -->



   <!--3rd div -->
          <div class="row">
            <div class="col-md-9">

              <div  class="nav-tabs-custom" id="tabs">

                <ul class="nav nav-tabs">
                @foreach($countries as $country)

                   <li><a href="#tab_{{ $country->id }}" data-toggle="tab" >{!!$category->name!!}</a></li>
                   @endforeach


                </ul>
                <div class="tab-content">
                @foreach($countries as $key => $country)

                  <div class="tab-pane" id="tab_{{ $country->id }}">
                  <table class="table" id="tables">
                                    <thead>
                                        <tr> 
                                            <th></th>
                                            <th colspan="5"></th>
                                            <th></th>
                                        </tr>
                                   </thead>
                                   <tbody id="food_list">
                  @foreach($country->teams as $team)
                                     <tr>
                                        </tr>
                  @endforeach       
               </tbody>
               </table>
                 </div>
                @endforeach     
                  </div>    

                </div>

              </div>

            </div>
   <!--End of 3rd div -->
   </form>
   </div>
   </div>

关于html - 如何将div移动到屏幕的右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47799178/

相关文章:

javascript - 基于设备宽度的中心网格

html - 如何获得全尺寸的 a-tag

javascript - 对 Angular 分割 div 并响应式

html - 图像被截断

javascript - 将 Canvas 定位在重叠 Canvas 下方

html - 7 Bootstrap 中的列网格在 xs 处崩溃

html - 无法使滚动条消失 - 不知道如何正确使用 CSS

html - IE 9 中的 iframe 内容中断

javascript - X-可编辑的巨大 list

javascript - 调整浏览器窗口大小时保留在内容中