I've been struggling to align my short bio on my webpage. I used Bootstrap to create a column layout with a picture and text, but I can't seem to center it properly.
Various attempts were made, including using float: left
and float: right
, as well as display: block; margin: 0 auto;
. However, none of these methods worked for me.
I believe the key is to create a single element that contains both the image and text side by side, and then centering it. Unfortunately, I have not been successful in achieving this.
If anyone could provide guidance on how to achieve the desired effect, I would greatly appreciate it.
Edit: Here's an example of what I'm trying to accomplish: https://i.sstatic.net/ip15p.png
This is what I currently have:
.profile-pic {
border-radius: 50%;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row">
<div class="col-md-2 col-xs-9">
<img class="img-responsive profile-pic" src="https://avatars0.githubusercontent.com/u/9438853">
</div>
<div class="col-md-10 col-xs-auto">
<h1>Telmo "Trooper"</h1>
<h4><a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0672636a6b69287274696976637446616b676f6a2865696b">[email protected]</a>"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5c283930313372282e33332c392e1c3b313d3530723f3331">[email protected]</a></a></h4>
</div>
</div>
</div>