Jump to content

Centering Image Within A Percentage Defined Div, On Different Resolutions


coco243
 Share

Recommended Posts

Hi, I have an issue, I don't know how to center an image, or a div if it is necessary, within my page container, my page container has it's margins sets in percentages. I tried to center it with margin-left in percentage, it's working on my screen resolution, but when I check on other PC's, it's not centered, or when I resize the browser dimensions, the image it's wrong positioned. I tried to stick the image in a paragraph, and to center the paragraph with align="center", without a result. I would be grateful if you guys can help me.Thx.

Link to comment
Share on other sites

My key in resolving these problems, was first and the most important thing to asociate percentage dimensions to my images. In the image tags I specified the margin-left in percent, then I put this images in divs. Something like this: <div><img src="link to my image" style="margin-left: x%" width="x1%"; height="x2%" /></div> And this resolved my problem, now, my images are resizing with the screen resolution. Once again, the most import thing was to associate percentage dimensions at images.

Edited by damy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...