Answer the question
In order to leave comments, you need to log in
How to align a button to the center of a block?
The block itself has the following structure:
<div class="col-blog">
<img class="img-responsive" src="https://picsum.photos/264/167/" alt="image">
<h3>
<a href="">Fully compatible template</a>
</h3>
<hr>
<p>
Lorem est esse cupidatat in in ipsum non consectetur.
Id veniam consectetur enim cillum incididunt in fugiat
cupidatat exercitation qui exercitation officia quis ea.
</p>
<a href="#">
<button type="button" class="button">Read more</button>
</a>
</div>
.button {
margin-left: calc(50% - 48.5px);
}
Answer the question
In order to leave comments, you need to log in
div.controlls
a.button
/div controls
{
display flex
justify-content center
align-items center
width 100%
}
Or like you have dom
a {
display block
button { margin: 0 auto}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question