Centering <img>s, how?

Hello.. I'm trying to center some images so that they don't appear pressed to one side and as as result look unnatural. Text-align work, and neither does align (not even sure if that exists but i tried it), or automatic padding or margins.

It can't be a specific amount of px, it needs to be flexible.

Any and all help/ suggestions/ ideas will be much appreciated. Thx in advance.text-align: center; on the parent element.

EDIT: typo correctedTypo vladdy, just so you know..
And I don't want the parent element to be centered, just the images. I'll try putting it in a span and text-align'ing that,K' it works now.. thanks, Vladdy, I didn't know it had to be in a parent element, I added another div and styled that.text-align:
aligns the inline child elements of the block element it is applied to. So if you want to center images within some div you apply text-align: center to that div. No need for extra spans and other tag soop, just RTFM: <!-- m --><a class="postlink" href="http://www.w3.org/TR/2004/CR-CSS21-20040225/There">http://www.w3.org/TR/2004/CR-CSS21-20040225/There</a><!-- m --> was, in my case. The images I wanted centered were in the same <div> as my navigation. The navigation was already aligned to the left, and I wanted to keep it that way, and center the images. So I just added a nested div with inline styling and.. booya. It works, Thx again.
 
Back
Top