display: inline-block; How do I center a list in HTML? What is the correct way to screw wall and ceiling drywalls? @David along with the css turn off point that Chris pointed out, I would also suggest it is more semantic than other suggestions as with a lot of navigations, all you would require is the ul and li and it saves using other divs etc. A formatting setting that specifies how content is positioned within the horizontal space of a cell, object, or page. Then, we add the justify-content property with the "center" value. It would be more helpful if you also provided a link to your code so that one is able to experiment with it to trace the problem. Use this method to center an element vertically and horizontally if you don't know its exact dimensions and can't use Flexbox. Why not simply float the images next to each other? The element takes up its specified width and divides equally the remaining space by the left and right margins. To learn more, check out the documentation on Responsive Design, Dark Mode and other media query modifiers. See the Pen Simple Horizontal List (CSS) by Jeremy Caris (@jeremycaris) on CodePen. You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. Its not as semantic as a