How to center a popup modal in servicenow portal?

Raphael Dizon
Mega Expert

Hello,

Any idea on how to center my modal pop up? When my browser is maximized the pop up is located at the right side

find_real_file.png

But when I minimize my browser to a certain width, it is completely fine and centered.

find_real_file.png

Kind Regards,

Raphael

 

1 ACCEPTED SOLUTION

Hello, 

I think I found the reason why the modal is appearing on the right side. I tried to uncheck the 'left:50%' in modal-dialog and i set the left to 0% and it is now appearing at the center

find_real_file.png

View solution in original post

18 REPLIES 18

Oleg
Mega Sage

Could you post more details how you create the modal pop-up? Do you used spModal$uibModal or some other AngularJs directive? One can display modal pop-up in different ways with respect of AngularJs or without it (for example using pure Bootstrap). Please post your code and please write whether you mean horizontal or vertical centering or both.

Hello,

I used $uibModal in Client script.I just want it to appear at the top of the page and centered vertically. Here is the code in html and client script:

find_real_file.png

If you are using Chrome, try inspecting the element indicated here. In this example, I have purposefully added "float: right" to make the dialog appear on the upper right corner.

Without knowing more information it's hard to diagnose what could be causing the issue.

find_real_file.png

Hello,

May I ask what should I be looking at?

find_real_file.png