Justify-content for text?

Justify-content for text?
0.0 0

#1

Hey, so I’m trying to create a project and earn a certification here. For one of my headers, I wanted to add a background color to make ti more aesthetically pleasing. However, I ran into an issue in that the background-color would be too small, and it would not look that aesthetically pleasing at all, so I changed the height of my container to be taller. However, then the text that was in my header was not in the center, vertically, of the container. I tried using justify-items, but somehow it does not work. Can somebody help me wit this? I’ve skipped the code that is not necessary for the sake of this question, but put it in a format that should be generally recognizable.

<style>
#the-companies {
  background-color: black;
  color: white;
  height: 80px;
  align-items: center;
}
</style>
<body>
<h1 class="text" id="the-companies">THE COMPANIES</h1>
</body>

#2

Are you using flexbox? If not, align-items is not a valid property.

Try the following:

#the-companies {
  background-color: black;
  color: white;
  text-align: center;
  line-height:80px;
}