Ask coding questions

← Back to all posts
How do I center a UL in HTML?
ColePete (30)

In my repl, I am trying to center a UL in HTML. I want the bullet points to line up in the center of the page. Plz help.

Answered by InvisibleOne (2996) [earned 5 cycles]
View Answer
Comments
hotnewtop
InvisibleOne (2996)

First off, you should put a closing </ul> after your list. Then try adding this to the css

ul {
  text-align: center;
  width: 300px;
  margin: auto;
}