My goal is to center my div element while keeping the text aligned to the left. Here's the code I have:
<div class="container">
<div class="row">
<div class="col">
<h1><strong>Hello, what we can do for you?</strong></h1>
</div>
</div>
</div>
I attempted to use "text-center" in the container class and apply "text-align: left;" to the col class. However, this centered both the div element and the text. I'm struggling to figure out how to center the div element but keep the text aligned to the left.
This was my unsuccessful attempt:
HTML
<div class="container text-center">
<div class="row">
<div class="col">
<h1><strong>Hello, what we can do for you?</strong></h1>
</div>
</div>
</div>
CSS:
.col{text-align:left;}