CSS for full width containers Service Portal

jotasolano
Kilo Contributor

Screen Shot 2016-05-23 at 10.09.49 AM.png

Hello! I was asked to intervene the UI of a Service Portal page. I modified the "Homepage Search" widget to include a button below the search bar. However, the background image that was set under the Branding Editor is no longer visible for this widget. I decided that I wanted to have a background-color property instead, and that I wanted the container to span the full width of the page (equivalent to the container-fluid bootstrap class). Is there a way to do this?

Things I have tried:

1. Creating a div before the actual search widget div and setting position:absolute and width: 100% (results shown in image above)

2. Passing a CSS class to the widget container (which is 12 column) and passing width:100% to it under the Page Properties CSS (it results in a wrong rendering of the container, with 15px padding on both sides, but only visible on the left side). I don't want to edit the padding of this element because that's very wrong in terms of bootstrap practices.

Is it possible to pass a container-fluid class to the container element or some other way to make full-width containers/widgets inside a Service Portal page?


Thanks for the help.

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Antonio,



It looks like if you go into the page record in service portal you can access the actual container records. Those records have a dropdown where you can select Fixed vs Fluid so you shouldf3429f68e0.png be able to set it there.


View solution in original post

10 REPLIES 10

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Antonio,



It looks like if you go into the page record in service portal you can access the actual container records. Those records have a dropdown where you can select Fixed vs Fluid so you shouldf3429f68e0.png be able to set it there.


Oh wow, I feel silly now. Thanks, that fixed it perfectly


joshuadesouza
Kilo Explorer

Anyone figure out how to get the container to be the full height of the page? Width is working but not height.



Thanks!


Hi Josh,



Height is generally a more complicated issue. In general the height of something is determined by the height of it's contents.