Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Align Images in Background</title>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  <style>
    p {
      margin-bottom: 3rem;
    }
    .ex-image-wrap {
      width: 100%;
      height: 200px;
      background: #000 url('https://picsum.photos/id/63/1200/600') no-repeat;
      background-size: cover;
      background-position:  center;
    }
    .bp-top {
      background-position: top center;
    }
    .bp-bottom {
      background-position: bottom center; 
    }
  </style>
</head>
<body>
  <div class="container-fluid text-center pt-5">
    <div class="ex-image-wrap bp-top">
        <!-- An empty div element -->
    </div>
    <p>Align top (background-position: top center)</p>
    <div class="ex-image-wrap">
        <!-- An empty div element -->
    </div>
    <p>Align center (background-position: center)</p>
    <div class="ex-image-wrap bp-bottom">
        <!-- An empty div element -->
    </div>
    <p>Align bottom (background-position: bottom center)</p>
  </div>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
masoomulhaqspro
0viewers