Previous Message
Next Message

Any working method to size margins on images based on images own size?

Sent by Georg on 9 July 2012 16:04


Case: images are resized by max-width, and sinse margin-top is a kind of 
constant the images' top stays fixed at original position. What if I 
want some images to be repositioned based on their center or any other 
"internal point" when resized - as we can do with background images?

To a certain degree this can be done by declaring margins in % and 
mixing regular margins with relative positioning, but since % calculates 
its value from container width the effect can be somewhat "too 
interesting" (make images move in strange ways) in cases where the image 
is not 100% wide to begin with or isn't resized by a max-width of 100%.

Can 'calc()' solve the problem, and if so is 'calc()' usable across 
browser-land?

regards
         Georg
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: