I've looked through many posts on this topic but the traditional solutions don't seem to be working. I'm most likely doing something wrong but I can't see what. I'm trying to center the text within a div while keeping it left justified. Here is my code/markup:
HTML
<div class="home">
<div class="title">
Hi, I'm <a href="#">name</a>. This is some of my <a href="#">work</a>.
</div>
</div>
CSS
.home {
padding: 120px 75px 0px 75px;
margin: 0 0 200px 0;
width: calc(100% - 150px);
height: auto;
text-align: center;
}
.title {
display: inline-block;
text-align: left;
color: var(--text-primary);
}
At the moment I have it set up so the text within the title div is left justified, and the title div is centered within the home div (at least I think that's what's going on.) I've also tried flex box, but to no avail. I think the issue has to do with the fact that the text in the h1 tag wraps, leaving space on the right side (selected in red below). Here is what I mean:
Thank you for looking, I appreciate any suggestions!