4

I need center (horizontally and vertically) content of my enter page. I am using Bootstrap 4 beta, and I go by guide on BS page, but it's not working - https://getbootstrap.com/docs/4.0/layout/grid/

    html, body {
    height: 100%;
    }

    .bg-color {
        width: 100%;
        height: auto;
        min-height: 100% !important;
        background: #4e4376;  
        background: -webkit-linear-gradient(to bottom, #2b5876, #4e4376);  
        background: linear-gradient(to bottom, #2b5876, #4e4376);
        
    }
    body::after {
        content: "";
        background-image: url("assets/group.jpg");
        opacity: 0.1;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        position: absolute;
        z-index: -1;  
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover; 
    }
    <div class="container-fluid">
        <div class="row justify-content-center align-self-center">
            <div class="col col-sm-6 col-md-6 col-lg-4 col-xl-3 h-100">
                <form action="">
                <div class="form-group">
                    <input _ngcontent-c0="" class="form-control form-control-lg" placeholder="User email" type="text">
                </div>
                <div class="form-group">
                    <input class="form-control form-control-lg" placeholder="Password" type="password">
                </div>
                <div class="form-group">
                    <button class="btn btn-info btn-lg btn-block">Sign In</button>
                </div>
              </form>
          </div>
      </div>
  </div>

Can you help me to fix it? Thanks

For better explaining what I need: enter image description here

Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174

1 Answers1

-3

You have to include bootstrap in your project. Notice the first line of html.

html, body {
    height: 100%;
    }

    .bg-color {
        width: 100%;
        height: auto;
        min-height: 100% !important;
        background: #4e4376;  
        background: -webkit-linear-gradient(to bottom, #2b5876, #4e4376);  
        background: linear-gradient(to bottom, #2b5876, #4e4376);
        
    }
    body::after {
        content: "";
        background-image: url("assets/group.jpg");
        opacity: 0.1;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        position: absolute;
        z-index: -1;  
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover; 
    }
<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">
<div class="container-fluid">
        <div class="row justify-content-center align-self-center">
            <div class="col col-sm-6 col-md-6 col-lg-4 col-xl-3 h-100">
                <form action="">
                <div class="form-group">
                    <input _ngcontent-c0="" class="form-control form-control-lg" placeholder="User email" type="text">
                </div>
                <div class="form-group">
                    <input class="form-control form-control-lg" placeholder="Password" type="password">
                </div>
                <div class="form-group">
                    <button class="btn btn-info btn-lg btn-block">Sign In</button>
                </div>
              </form>
          </div>
      </div>
  </div>
kpie
  • 9,588
  • 5
  • 28
  • 50