Reputation: 3619
I am doing a website and I don't know how to do aligning of images wrapped in < li >.
Here you can see the page - http://www.dansid.cz/praginfo/services.php?l=de
I need those images to automatically align on center, how can I do that with CSS?
You can see the CSS etc. by right clicking in Firefox or Chrome and clicking Inspect Element.
Thanks for your answers :)
Upvotes: 1
Views: 2295
Reputation: 75409
By images in li
s i assume you're referring to the thumbnails found in your site, you can center them by declaring them display:inline-block
instead of float:left
and then simply centering them in their container by setting the text-align:center
property in it, like so:
#navlist li {
display:inline-block;
*display:inline; /* ie7 fix */
}
Note: remove the float property.
#navlist {
text-align:center;
}
Upvotes: 2
Reputation: 14259
Try on the parent li text-align: center
for li elements with a width larger than the images
If you want to align the whole ul to the center than I would suggest giving it the attributes:
margin: 0 auto;
display: block;
width: //your width;
Upvotes: 0