T. Jung T. Jung - 1 year ago 76
CSS Question

How to position html objects on a portlet jsp?

I'm trying to position objects like

in a
page via


.btn {
position: relative;
top: 10px;
/* more css */

The result:Positon: relativ; top: 10px;

The problem i have is, that there is a scrollbar at the left side of the portlet, which is scrollable the
from the
file, but i don't want that my portlet have a scrollbar. If i remove the
position: relativ;
the page looks like this:

Without any position attribute

This is a bit better cause there is no scrollbar, but as you can seen in the red box, the buttons have no space to the
, which also looks bad.

I tried:

  • Put a
    around the code (nothing happend)

  • position: absolute
    (like expected the button were somewhere on the site)

  • posotion: static

Want i want to achieve:

objects somewhere on the
page without the scrollbar on the left or on the bottom.

I'm using the WebSphere Portal Server 8.5.
Thank you in advance.

Answer Source

Use margin-top (on a div around the buttons) to move them without leaving their original space reserved.

div.btn-container {
    margin-top: -10px;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download