This is how my sidebar looks right now. Colored to easily identify the elements. My code is
.sidebar {
display: grid;
background-color: royalblue;
height: 100%;
width: 160px;
position: fixed;
justify-content: center;
}
.sidebar ul {
background-color: green;
justify-content: center;
}
.sidebar a {
text-decoration: none;
color: black;
background-color: red;
display: block;
text-align: center;
font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}
<aside class="sidebar">
<ul>
<a href="#">a</a>
<a href="#">b</a>
<a href="#">c</a>
</ul>
</aside>
- How do I center the text in the green box both vertically and horizontally?
- Why is there space on top of the green box?