In the everlasting pursuit to center a horizontally placed graphic and have it auto-locate on resize, here is a hopefully simple solution that may finally provide some relief. The calc() method, which is widely supported by most browsers, is used in the following syntax for a graphic with a width of 728px.
If the full width is 728px, then getting 50% would mean 364px. To achieve this, use the code snippet below:
#imagecentre2 {
left: calc(100% / 2 - 364px);
/*additional syntax*/
}
It's crucial to include white space on either side of the '+' and '-' symbols for correct functionality of both negative and positive values. This practice should also be extended to the '/' and '*' symbols for consistency. The order of execution typically follows +, -, *, /. Remember, Calc() has its limitations and doesn't support 'auto'! Try it out and see how it works!