I'm having trouble aligning the navbar vertically with my website logo and header. I've tried using display: inline-block;
and vertical-align: middle;
on the , , and tags within the same div at the top of my website, but it ends up switching from a horizontal to vertical layout, which is not what I want. I am also utilizing Bootstrap 4.
Below is my HTML code:
<div id="home">
<div class="page-header">
<div class="container">
<div class="row">
<div class="col-md-4">
<img src="images/test-logo.png">
<h1>Rigid Signs</h1>
</div>
<div class="col-md-8">
<ul class="nav">
<li><a href="#home">Home</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
And here is the corresponding CSS:
#home {
background: url('../images/workshop-testphoto.jpg') no-repeat center / cover;
height: 844px;
}
.page-header {
background: rgba(0,0,0,.6);
position: fixed;/*not working*/
padding: 11px 0;
}
.page-header img, .page-header h1 {
display: inline-block;
vertical-align: middle;
}
.page-header img {
width: 88px;
}
.page-header h1 {
font-size: 32px;
color: white;
margin-left: 11px;
}
.page-header .nav {
float: right;
}
.page-header .nav li a {
display: inline-block;
font-size: 22px;
text-decoration: none;
color: #fff;
}
I am still learning how to use Bootstrap 4 effectively, so if anyone has suggestions on how to achieve vertical alignment of all elements in my navbar using Bootstrap 4, I would greatly appreciate your help!