I'm struggling with centering text within my website links, specifically in the navigation section "about me," "portfolio," "skills," and "contact." I've tried adding the text-center
class and using the text-align
function in the CSS, but nothing seems to work.
The code snippet below shows the structure of my website's navigation bar and the attempts I've made so far. I believe someone with HTML experience could easily identify the issue and provide a solution.
#mainContainer{
z-index:0;position:fixed;
width:100%; height:100%;
background-color: white;
}
.headerClass{
margin-top:auto;
margin-bottom:auto;
}
#headText{
color:white;
font-size: 1.5vw;
font-family: fantasy;
vertical-align: middle;
}
#infoBox{
height:100%;
width:100%;
}
#infoBoxCol{
background-repeat: no-repeat;
background-size:cover;
}
.navbar{
border-style: solid;
border-color: white;
width: 100%;
color:white;
font-family:fantasy;
font-size: 1.1vw;
text-align:center;
}
.navRoof{
text-align:center;
width:100%;
height:10%;
background-color:white;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<div class="container-fluid text-center" id="mainContainer">
<div class="row" style="background-color: black; height:30%;">
<div class="col-4 my-auto text-fluid" class="headerClass" id="headText">
Software Developer
</div>
<div class="col-1"></div>
<div class="col-2 my-auto"><img class="img-fluid" src="images/logo.jpg" style="max-width:85%;"></div>
<div class="col-1"></div>
<div class="col-4 my-auto">
<div class="row" id="navigation">
<div class="col-3"><a href="Index.php" class=" navbar text-center">About Me</a></div>
<div class="col-3"><a href="Index.php" class="navbar text-center">Portfolio</a></div>
<div class="col-3"><a href="Index.php" class="navbar text-center">Skills</a></div>
<div class="col-3"><a href="Index.php" class="navbar text-center">Contact</a></div>
</div>
</div>
</div>
</div>