我们看可以设置浮动 (.float-*-left|right - * 为 sm, md, lg 或 xl)的方向依赖于屏幕的大小: 
 
实例: 
 
<!DOCTYPE html> 
<html> 
<head> 
  <title>Bootstrap4 实例</title> 
  <meta charset="utf-8"> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="external nofollow" target="_blank"  rel="external nofollow" target="_blank"  rel="external nofollow" target="_blank"  rel="external nofollow" target="_blank"  rel="external nofollow" target="_blank"  rel="external nofollow" target="_blank"  rel="external nofollow" target="_blank"  rel="external nofollow" target="_blank" > 
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" ></script> 
  <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" ></script> 
  <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" ></script> 
</head> 
<body> 
<div class="container"> 
  <h2>响应式浮动</h2> 
  <p>重置浏览器大小查看效果。</p> 
  <p>我们看可以设置浮动 (.float-*-left|right - * 为 sm, md, lg 或 xl)的方向依赖于屏幕的大小:</p>  
  <div class="float-sm-right">在大于小屏幕尺寸上右浮动</div><br> 
  <div class="float-md-right">在大于中等屏幕尺寸上右浮动</div><br> 
  <div class="float-lg-right">在大于大屏幕尺寸上右浮动</div><br> 
  <div class="float-xl-right">在大于超大屏幕尺寸上右浮动</div><br> 
  <div class="float-none">没有浮动</div> 
</div> 
</body> 
</html> 
尝试一下 |