W3C home > Mailing lists > Public > www-style@w3.org > February 2017

[css-layout] Object tag content dimensions

From: Jan Tosovsky <j.tosovsky@email.cz>
Date: Sat, 18 Feb 2017 01:48:35 +0100
To: <www-style@w3.org>
Message-ID: <018b01d28980$bd343460$379c9d20$@tosovsky@email.cz>
Dear All,

when SVG graphics is placed into HTML via <object> tag, it fills the
container maintaining the original aspect ratio.

This means (demonstrated on
http://drifted.in/other/firefox/centered-object-click-event.html ):
(1) you cannot set the border around that inner content (that light frame is
not touching that red rectangle)
(2) you cannot define hit area for mouse click events only to that inner
content (now active inside the complete light frame)
(3) on the contrary, when you define mouse click events on the remaining
area, they are restricted to a very limited area as the rest is hidden by

Is there any chance to have some flag for the future to prefer those inner
object dimensions after fitting the object into the container?

My goal is to create a kind of 'lightbox'. When user clicks to the graphics
inside the page content, it is enlarged, surrounded with tiny border (and
translucent background). When user clicks outside that image, the 'lightbox'
is closed.

Currently I employ various hacks, but I hope it could be done more
efficiently in the future.


Received on Saturday, 18 February 2017 00:49:09 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:15:02 UTC