Lab_Tech
asked on
Centering an image in a browser regardless of browser / screen size?
Probably a very simple thing to fix but nonetheless I have not really come up with a solution that addresses this problem.
Basically, I have a webpage that features a background template (a JPEG File). For example, look at the experts exchange site. Imagine the white part being the background template. The grey on the left and right sides changes in width depending on your browser (if it's maximized or not) and your screen width, but regardless, the middle white part remains centered and balanced. It doesn't stretch and distort.
So I guess what I am looking for is a code example in HTML to show me how to do this?
Thanks,
Lab_Tech
Basically, I have a webpage that features a background template (a JPEG File). For example, look at the experts exchange site. Imagine the white part being the background template. The grey on the left and right sides changes in width depending on your browser (if it's maximized or not) and your screen width, but regardless, the middle white part remains centered and balanced. It doesn't stretch and distort.
So I guess what I am looking for is a code example in HTML to show me how to do this?
Thanks,
Lab_Tech
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Give background-position: center; for the background-image used,.