我试图实现以下目标。 样机: http://pasteboard.co/iNg55T4.png
以下代码在移动设备(xs)上看起来不错,但在桌面设备(md或更高版本)上定位错误。我尝试了各种推/拉但无济于事。我使用w3schools网站玩他们的编辑器,并在下面的代码。
在w3学校使用此链接和代码 http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_grid_stacked_to_hor&stacked=h
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-6" style="background-color:lavenderblush;">
<p>1 this is div 1</p>
</div>
<div class="col-xs-6 col-md-6" style="background-color:lavender;">
<p>2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div 2 2 this is div</p>
</div>
<div class="col-xs-6 col-md-6" style="background-color:lavenderblush;">
<p>3 this is div 3</p>
</div>
<div class="col-xs-6 col-md-6" style="background-color:lavenderblush;">
<p>4 this is div 4</p>
</div>
</div>
</div>
</body>
</html>
如果有人能帮助回答这个难题,我们将不胜感激。