html - 两列不同位置

标签 html css twitter-bootstrap

我想做一些不太难的事情,但我不知道该怎么做。

现在我有了移动版现在的样子。

手机版是这样的: enter image description here

这就是我想要的样子: enter image description here

我这里有代码。

  $query = "SELECT * FROM my_table";
                    $res = mysqli_query($con, $query);
                    $i = 0;
                    while ($row = mysqli_fetch_assoc($res))             
                   {
                   if($i%2==0)
                   {
                  echo "<div class='row' style='margin-right:0; margin-left:0'>



            <div class='col-md-6' style='padding:0;''>
                <img class='image-width img-responsive' src='images/my_img/".$row['primary_img']."' />
                        </div><!--/span-->


                <div class='col-md-6 find-content' style='margin-top:8%;'>
                   <img src='images/my_img/".$row['icon']."'/>
                    <p style='font-family:GothamBold;color:#ec1940;font-size:1.5em; margin-top:5%;'>".$row['title']."</p>
                    <p style='width:50%;margin-left:25%;' class='text'>".$row['text']."</p>
                  <a class='a-button'  href='atractions.php?id=".$row['id']."'>Hi</a>            
                </div><!--/span-->
                </div><!--/row -->";
             }
        else
        {
            echo " <div class='row' style='margin-right:0; margin-left:0'>

        <div class='col-md-6 find-content' style='margin-top:10%;'>
         <img src='img/descopera/icons/".$row['icon']."'/>
            <p style='font-family:GothamBold;color:#ec1940;font-size:1.5em; margin-top:5%;'>".$row['title']."</p>
            <p style='width:50%;margin-left:25%;' class='text-descopera'>".$row['text']."</p>
          <a class='a-button'  href='atractions.php?id=".$row['id']."'>Hi</a>    
        </div><!--/span-->


         <div class='col-md-6' style='padding:0;'>
              <img class='image-width img-responsive' src='images/my_img/".$row['primary_img']."' />
            </div><!--/span-->

        </div><!--/row--> ";
        }   
        $i++;
    }   

最佳答案

我再次复制了代码并使用了名为“visible”的 Bootstrap 类

关于html - 两列不同位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38823205/

相关文章:

javascript - 从客户端 (AngularJS) 向 Node.js 服务器发送图像

html - 用于网站导航的 .css 列

html - 内联 block 元素换行时的CSS,父包装器不适合新宽度

javascript - 在本地主机中没有文本时不显示进度条

html - 响应式 slider 按钮

html - MySQLdb._exceptions.OperationalError : (1136, "Column count doesn' t 行 1 处的匹配值计数")

javascript - 如何从属性中获取数据然后相应地禁用按钮

html - 为什么我的 CSS 按钮在 :active? 时移动相邻按钮

twitter-bootstrap - 使用 Bootstrap 处理下拉项目选择事件

html - 如何在两种颜色的 Bootstrap 中拆分屏幕