我想把产品卡建立成一个分屏,但它们继续堆叠在一起,而不是并排。
有人有解决办法吗?
我的代码可以在下面找到。我是一个编码新手,所以忽略一些图片和缺乏经验。这段代码的目的是为了创建一个统一的显示正在拍卖的慈善项目。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stuf Auction</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Montserrat+Alternates&display=swap" rel="stylesheet">
<link rel="stylesheet" href="node_modules/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="stufcss.css">
</head>
<body>
<!-- left side -->
<div class="split left">
<div class="centered">
<img src="images/stufgreen.png" alt="stuf logo">
<h2></h2>
<p></p>
</div>
</div>
<!-- right side -->
<div class="split right">
<div class="centered">
<div class="container">
<div class="row row-content">
<div class="card">
<img src="images/jordanshoes.jpg" alt="Denim Jeans" style="width:100%">
<h1>Tailored Jeans</h1>
<p class="price">$19.99</p>
<p>Some text about the jeans. Super slim and comfy lorem ipsum lorem jeansum. Lorem jeamsun denim lorem jeansum.</p>
<p><button>Bid</button></p>
</div>
<div class="card">
<img src="images/jordanshoes.jpg" alt="Denim Jeans" style="width:100%">
<h1>Tailored Jeans</h1>
<p class="price">$19.99</p>
<p>Some text about the jeans. Super slim and comfy lorem ipsum lorem jeansum. Lorem jeamsun denim lorem jeansum.</p>
<p><button>Bid</button></p>
</div>
</div>
</div>
</div>
</div>
<!-- footer -->
<footer class="site footer">
<div class="container">
<div class="row">
<div class="col-4 col-sm-2 offset-1">
<h5>Links</h5>
<ul class="list-unstyled">
<li><a href="#">Home</a></li>
<li><a href="aboutus.html">About</a></li>
<li><a href="contactus.html">Contact</a></li>
</ul>
</div>
<div class="col-6 col-sm-5 text-center">
<h5>Social</h5>
<a class="btn btn-social-icon btn-instagram" href="http://instagram.com/"><i
class="fa fa-instagram"></i></a>
<a class="btn btn-social-icon btn-facebook" href="http://facebook.com/"><i
class="fa fa-facebook"></i></a>
<a class="btn btn-social-icon btn-twitter" href="http://twitter.com/"><i class="fa fa-twitter"></i></a>
<a class="btn btn-social-icon btn-google" href="http://youtube.com/"><i class="fa fa-youtube"></i></a>
</div>
<div class="col-sm-4">
<a role="button" class="btn btn-link" href="tel:+12065551234"><i class="fa fa-phone"></i>
1-206-555-1234</a><br />
<a role="button" class="btn btn-link" href="mailto:[email protected]"><i class="fa fa-envelope-o"></i>
[email protected]</i>
</div>
</div>
</div>
</footer>
</body>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
</html>
有没有类作为 split
在bootstrap-4中,你可以使用bootstrap-grids。如果你想分割你的屏幕,你可以使用bootstrap-grids中的
<div class="container">
<div class="row">
<div class="col-sm">
One column
</div>
<div class="col-sm">
One column
</div>
</div>
</div>