T. Jung T. Jung - 1 month ago 14
CSS Question

How to position html objects on a portlet jsp?

I'm trying to position objects like

<button>
in a
.jsp
page via
css
.

MyTheme.css:

.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
10px
from the
MyTheme.css
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
<fieldset>
, which also looks bad.

I tried:


  • Put a
    <div>
    around the code (nothing happend)

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

  • posotion: static



Want i want to achieve:

Position
html
objects somewhere on the
.jsp
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

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

div.btn-container {
    margin-top: -10px;
}
Comments