Although this question is asked before, my problem is little different. I have a div, within which I have two images. First image needs to be stayed left align, where as the second image needs to be center aligned. The div has no fixed width, so that it covers the heading. I have created a fiddle, which can be found here.
Any suggestion will be very helpful to me.
Case 1
Add
text-align:centerto the div class.Give
float:leftto the first image by using pseudo class so that your second image will be center aligned to the div and first image will be left aligned.Here is the demo http://jsfiddle.net/Eevpc/5/
Case 2
Do it by
position:absoluteDemo http://jsfiddle.net/Eevpc/11/
In case 1, second image is center for the remaining width of the div (ignoring the space occupied by the first image).
In case 2, second image is aligned to the exact center of the original div width.