Have you checked the actual HTML generated?
Then the CSS applied to it?
Have you checked the actual HTML generated?
Then the CSS applied to it?
From the screenshot I would say that the items are not center-aligned, but rather offset from the left.
Try decreasing the margin-left
/padding-left
for your #ulCategoryMenu
. As a quick example, try:
<ul id="ulCategoryMenu" name="ulCategoryMenu" style="margin-left:0;padding-left:0">
You might also have to decrease the left padding for your li
s, depending on what CSS rules have been previously applied to them.
See also Listamatic for further inspiration.
Set margin to 0, a little padding-left and a line-height (maybe 20px) to your li elements. By default, li have a margin-left/padding-left (depending on the navigator).
(The line-height if for the li to be more separated from each other. A padding-top and bottom can also works.)
Try this out and see if it works for you:
<div id="divCategoryMenu" name="divCategoryMenu" style="background-color:#BCD2E6;">
<ul id="ulCategoryMenu" name="ulCategoryMenu" style="list-style:none;padding-left:-2px;margin-left-2px;">
<li>Zilla Parishad</li>
<li>Nagar Parishad</li>
<li>Taluka Panchayat</li>
<li>Gram Panchayat</li>
</ul>
</div>
If your <li>
elements are instead <label>
elements, make sure they're properly wrapped in <li>
tags.
Edit: of course, once you get the style worked out properly, you should move the styles to your stylesheet.
The above code should give you a list, with no bullets, and pull the list slightly to the left.
It is recommended to assign the padding and margin for lists and list-items. The reason for this is twofold: 1, there are default settings for margin and padding that are typically undesired for navigable lists. 2, Firefox and IE handle their spacing differently, i.e., Firefox with use padding, IE margin (or vice versa, can't remember), and thus they both must be overridden in order for the final product to look the same in both browsers.
Additionally, the contents of an ol
or ul
must be li
. If you have other elements, they must be wrapped in an li
element.