Help With service portal HTML widget or formatting containers for pictures

JohnScarlata
Kilo Contributor

Having trouble with getting a picture to display properly in Portal, when viewed on various sized screens of varying resolutions, the image is pushed and pulled and squished based on the size of the screen/resolution.

i have tried putting the image into the container background, set the width to fluid, and image to either Cover, Contain, or default and i cant get it to work.  on a large 4k screen it will get distorted, if i resize the picture to fit, then on smaller screens the image is not showing completely.

I tried using the html widget inside a 12 wide container.  this works the best, however the html widget doesnt extend to the edges of the container, leaving blank space on either side of the widget, this space is increased on a bigger/higher res screen.

is there a way to make the html widget extend to the full size of the container edge to edge?

is there a better way to do this?  

image 1 - fixed width container, set to Contain, theres spaces on each side, takin on std 1920x1080

image 2 same as above on 4k screen

Image 3 - Fluid, set to COVER, on 4k

Image 4 - Fluid, set to cover, on 1080

you can see how things are moving around...

image 5 - image is in the HTML widget, note spaces on the sides

Image 6 same as 5 but on 4k screen

 

 

1 REPLY 1

Cuong Phan
Kilo Sage

Hi John,

This is because of bootstrap class as below

find_real_file.png

You can fix this by adding this CSS to your img tag within the widget

    margin-left: -8px;
    margin-right: -7px;

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.

 

Cuong Phan

DXC Consultant.

Regards,
Cuong Phan
ServiceNow Technical Lead