Personal project. Dogecoin (HTML/CSS) . Need help with centering navigation items

Hello. This is my very first project in HTML/CSS. I would be grateful for reviewing my code. Every critics and suggestions are accepted :slightly_smiling_face:

Main problem is how to place navigation items in the center of the page at the same line.

Link to the project files :point_down:

Hi there! Great website.
There are several ways how you can center items. You can center unordered list inside the navbar. To do this, your unordered list must be a block element with a certain width. Then you just specify that its left and right margin should be auto, like so:

#navigation ul {
  display: block;
  list-style-type: none;
  width: 80%;
  margin: 0 auto;

This will center the list itself, but won’t change the position of the list items inside the list though.
The easiest way for me to center items inside an element is by using CSS flex-box if you are familiar with it. Like so:

#navigation ul {
  display: flex;
  justify-content: center;
  list-style-type: none;

This way all your links always will be right in the middle of the page.

Thank you. That’s exactly what i needed :slight_smile:

1 Like