首页 > 解决方案 > Bootstrap 4 - 两张重叠的卡片之间的 div

问题描述

我需要在图片上做这样的事情(这个矩形在两张卡片之间有一个箭头,但也重叠它们)

预习 任何想法,我将不胜感激

标签: htmltwitter-bootstrap

解决方案


您可以更改类似这样的代码:

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css">

</head>
<body style="background-color:#eeeeee;padding:25px;">


<div class="card-columns">
  <div class="card" style="width:200;height:200px;border:none;padding-right:20px;padding-left:20px">
    <div class="card-body">
      <h5 class="card-title">Card title</h5>
      <p class="card-text">This is another card with title and supporting text below. This card has some additional content to make it slightly taller overall.</p>
    </div>
  </div>
  <div class="card" style="width:800px;height:200px;position:relative;border:none;padding-right:20px;padding-left:20px">
    <div style="width:60px;height:60px;background-color:#eeeeee;position:absolute;top:70px;left:-40px;text-align:center;line-height:60px;"><i class="fas fa-arrow-right" style="font-size:22px"></i></div>
    <div class="card-body">
      <h5 class="card-title">Card title</h5>
      <p class="card-text">This is another card with title and supporting text below. This card has some additional content to make it slightly taller overall.</p>
    </div>
  </div>
</div>


<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/popper.js@1.16.0/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>

</body>
</html>

https://jsfiddle.net/BahmanMD/7o983feq/3/


推荐阅读