0

I'm doing a college project and I need to create a card like this (I'm using bootstrap 5), but I don't know how to leave the image 50% out of the card like the image, can someone help me?

enter image description here

<head>
  <title>Basic Web Page</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>

<body>
  <div class="card" style="width: 18rem;">
    <img y="-50px" class="rounded-circle card-img-top mt-3 mx-auto img-thumbnail" alt="avatar2" src="https://mdbcdn.b-cdn.net/img/new/avatars/9.webp" />
    <div class="card-body">
      <h5 class="card-title">Card title</h5>
      <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
      <a href="#" class="btn btn-primary">Go somewhere</a>
    </div>
  </div>
</body>
isherwood
  • 58,414
  • 16
  • 114
  • 157

0 Answers0