Centering My Blog Picture

August 17, 2021    Web Development

Centering My Blog

My picture on my blog has been off center for a long time. I have Bootstrap loaded, but didn’t find the easy Bootstrap solution. I tried a few things, even Flexbox, but still didn’t get it (I admit I struggle with CSS and need to go back to learn basics, but haven’t used it a whole lot for a few years). After about 15 minutes of trying, I asked Jack at Omnitech. “use ‘margin:auto;‘“. Now I have a centered image 😊.

CSS from Chrome dev tools

<div class="avatar">
  <img class="img-circle" style="margin: auto;" src="https://www.aligneddev.net/img/kevin.jpg" alt="My picture">
</div>


comments powered by Disqus