Alex Rivera | Logout

Centering Bullets On A Centered List

Asked 2011-03-18T03:44:03.237
23

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?

Edit
Report

1 Answer

8

The problem is that the bullets are controlled by the ul rather than the individual lis. I don't know a clean way of doing this off the top of my head; as a quick hack, try

ul { list-style-type: none; text-align: center; }
li::before { content: "\2022 " }
/* 0x2022 is unicode for a bullet */

Edit: as the user above me points out, you should be centering in the stylesheet rather than with align.

To clarify, what we've actually done here is hidden the automatically-generated bullets (by setting list-style-type to `none) and created "pseudo-bullets" in front of each li.

answered 2011-03-18T03:57:59.127

Your Answer