+ 3
How to align center a list with the bullets?
I tried to make a list aligned to the center. but the bullet still in the left, not following to the the center too. https://code.sololearn.com/W6Srlqb1ygv5/#html
7 Answers
+ 5
ul {
margin:auto;
max-width:10px;
}
https://code.sololearn.com/WS2aZhww2MqD/?ref=app
Do not use align attribute, it's deprecated.
+ 3
So, the coder need to use margin to set the bullets distance?
+ 3
I should use width selector, however i cannot predict the ul width, so i use max-width, make sure max-width is smaller than the ul width (small number) so css itself would know how to adjust the actual width.
width is the width of ul, you can set background-color to see the difference by adjusting the width.
+ 2
ul {
display: flex;
flex-direction: column;
align-items: center;
}
+ 2
Is it true that Width inside your code is the distance from the center not from the left?
+ 2
Use margin: auto;
or flexbox as Sauron demonstrated
+ 2
or just
ul{
display:flex;
justify-content:center;
}