Hi Babu,
Here is my demo, please take it as reference:
1. My Portal is Customer Self-Service, so I add code in its Home web template source code.

2. As you see in screenshot, we can just add code at bottom position of original code, for both HTML element and css style tag.
Result:

If text exceeds the height of the div element, then the sidebar will be scrollbar due to attribute: overflow-y: auto.
Regards,
Clofly