Oracle APEX: Scale image to screen

Markus Appel picture Markus Appel · Sep 21, 2017 · Viewed 6.9k times · Source

I would like to scale an image that is saved in Shared Components so that the right side of it is exactly on the right end of the screen.

How is that possible?

I am using Oracle APEX 5.1.

Answer

Tony Andrews picture Tony Andrews · Sep 21, 2017

I am assuming you are displaying the image in a Display Image page item.

In the item properties, under Advanced, set the Custom Attributes property to:

style="width: 100%"

This screenshot shows two Display Image items based on the same small picture (held as a static application file). The second has the style property:

enter image description here See my demo page on apex.oracle.com

Alternatively, this could be done using CSS defined in a file or in page inline CSS like this:

#P123_MY_IMAGE_ITEM {
    width: 100%;
}

Or you could set the item's CSS Classes property to e.g. "full-width" and define the CSS as:

.full-width {
    width: 100%;
}

This is probably the best option if you will do this to many images.