我如何固定水平滚动? :/
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
导航栏 链接 链接 链接 链接
<section class="boxes">
<div class="container-fluid pl-0 pr-0">
<div class="row">
<div class="box col-lg-6"><img class="img-fluid" src="https://d22wsyl1zemnyu.cloudfront.net/images/frontendfront-logo-share.png"></div>
<div class="box col-lg-6"><img class="img-fluid" src="http://www.wearedigitalalchemy.com/wp-content/uploads/2015/08/backend.jpg"></div>
</div>
</div>
</section>
答案 0 :(得分:0)
您应该使用类pl-0
摆脱pr-0
和container-fluid
的使用,它将起作用。试试这个。
<section class="boxes">
<div class="container-fluid">
<div class="row">
<div class="box col-lg-6"><img class="img-fluid" src="https://d22wsyl1zemnyu.cloudfront.net/images/frontendfront-logo-share.png"></div>
<div class="box col-lg-6"><img class="img-fluid" src="http://www.wearedigitalalchemy.com/wp-content/uploads/2015/08/backend.jpg"></div>
</div>
</div>
</section>
答案 1 :(得分:0)
使用pl-0 pr-0
到box col-lg-6
并从pl-0 pr-0
删除container-fluid
<section class="boxes">
<div class="container-fluid">
<div class="row">
<div class="box col-lg-6 pl-0 pr-0"><img class="img-fluid" src="https://d22wsyl1zemnyu.cloudfront.net/images/frontendfront-logo-share.png"></div>
<div class="box col-lg-6 pl-0 pr-0"><img class="img-fluid" src="http://www.wearedigitalalchemy.com/wp-content/uploads/2015/08/backend.jpg"></div>
</div>
</div>
</section>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">Navbar</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Navbar Left -->
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
</ul>
<!-- Navbar Right -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
</ul>
</div>
</nav>
<section class="boxes">
<div class="container-fluid">
<div class="row">
<div class="box col-lg-6 pl-0 pr-0"><img class="img-fluid" src="https://d22wsyl1zemnyu.cloudfront.net/images/frontendfront-logo-share.png"></div>
<div class="box col-lg-6 pl-0 pr-0"><img class="img-fluid" src="http://www.wearedigitalalchemy.com/wp-content/uploads/2015/08/backend.jpg"></div>
</div>
</div>
</section>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<!-- Tether -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<!-- Bootstrap 4 -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
</body>
</html>
答案 2 :(得分:0)
您需要在行上使用no-gutters
来删除列中的填充...
<section class="boxes">
<div class="container-fluid px-0">
<div class="row no-gutters">
<div class="box col-lg-6"><img class="img-fluid" src="https://d22wsyl1zemnyu.cloudfront.net/images/frontendfront-logo-share.png"></div>
<div class="box col-lg-6"><img class="img-fluid" src="http://www.wearedigitalalchemy.com/wp-content/uploads/2015/08/backend.jpg"></div>
</div>
</div>
</section>