0
        .top-row{
            min-height: 50vh;
            min-width:  100vw;
            padding:0px;
         }

        .top-col{
            background: #CCCCCC;            
            align-content: center;
            min-height: 50vh;
            min-width: 100vw;
        }
        .bottom-col{
            background: #CCCCCC;            
            align-content: center;
            min-height: 50vh;
            min-width: 100vw;
        }
         .bottom-row{
            min-height: 50vh;
            min-width:  100vw;
            padding:0px;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="row top-row">
        <div class="col-12 top-col">
            <h2>Hello</h2>
        </div>
    </div>  
    <div class ="row bottom-row">
        <div class="col-12 bottom-col">
           <h2>World</h2>
        </div>
    </div>
</div>
</body>
</html>

I want to be able to center content vertically from just editing the css portion. I have done lots of research and tried many different this but I was not able to get a solution that works.

Isse Nur
  • 53
  • 8

1 Answers1

-1

If I understand your question, you want to align the text vertically, so for that just add text-align: center; to your two row class

.top-row{
            min-height: 50vh;
            min-width:  100vw;
            padding:0px;
            text-align:center;
         }

        .top-col{
            background: #CCCCCC;            
            align-content: center;
            min-height: 50vh;
            min-width: 100vw;
        }
        .bottom-col{
            background: #CCCCCC;            
            align-content: center;
            min-height: 50vh;
            min-width: 100vw;
        }
         .bottom-row{
            min-height: 50vh;
            min-width:  100vw;
            padding:0px;
           text-align:center;
        }
   
 <div class="container">
    <div class="row top-row">
        <div class="col-12 top-col">
            <h2>Hello</h2>
        </div>
    </div>  
    <div class ="row bottom-row">
        <div class="col-12 bottom-col">
           <h2>World</h2>
        </div>
    </div>
</div>
Peneh
  • 195
  • 1
  • 10