I have a sidebar with the a title in it and I want to center the title in the middle of the sidebar in such a way that the first letter of each word in the title is aligned vertically.
#sidebar {
height: 100%;
width: 250px;
position: fixed;
z-index: 1;
top: 0;
left: 0;
overflow-x: hidden;
padding-top: 20px;
background: linear-gradient(-90deg, #353f4d, #3f4957);
}
#title-div {
position: absolute;
top: 0;
width: 100%;
background-color: #2980b9;
}
.title-text {
display: inline-block;
margin-left: auto;
margin-right: auto;
font-family: Raleway;
color: #f2f1f1;
}
<body>
<div id="sidebar">
<div id="title-div">
<h1 class="title-text">The<br>Title</h1>
</div>
</div>
</body