Example - http://jstn.info/html.html - link rot, example no longer available.
Notice the text is centered, but the bullet points themselves are not. How can I align the bullet points while keeping the text/list centered?
You can use . parentOfUl{ text-align:center;} and then ul{ display:inline-block; }, and at last li{ text-align:center; }.
Bulleted lists should be aligned so the bullets are aligned; otherwise the bullets' effectiveness is greatly reduced. Itemized lists in general should not be centered.
To just center the text inside an element, use text-align: center; This text is centered.
Please see https://stackoverflow.com/a/6558833/507421
ul { list-style-position: inside; }
You asked the same question at Centering <UL> + Keeping <LI>'s Aligned and i already answered you.
Give your div a class name center
. Assuming your div width is 200px, margin:0 auto
will center and text-align:left
will align the text to the left while maintaining its centering due to margin auto.
.center{ width:200px; margin:0 auto; text-align:left; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With