1

I've got a popup window that is enabled the following way:

<input type="button" value="S&ouml;k" onClick="getElementById('popupD').style.display=''">

The relevant DIV is

<div class="popup" id="popupD" 
<% if(!showSearch) { %>
style="display: none;"
<% } %>
>
<%@ include file="handlaggarelist.jsp" %>
</div>

The popup appear but too high up on the page. The CSS for the popup is

.popup{
    border-color: #000; 
    border-style: groove; 
    border-width: 2px; 
    padding: 0px; 
    background-color: #FFF;
    font-size: 70%;
}

Can you help me position the popup since otherwise it appears at the top of the page?

Thanks

dbreaux
  • 4,982
  • 1
  • 25
  • 64
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424

2 Answers2

2

add position:absolute, top set to an acceptable distance from top and z-ndex on the popup. Make sure the z-index is a very high no. like 10000. This will render your popup on top of other element.

1

You can position your popup absolutely on the page with something like this:

.popup{
    border-color: #000; 
    border-style: groove; 
    border-width: 2px; 
    padding: 0px; 
    background-color: #FFF;
    font-size: 70%;
    position: absolute;
    top: 200px;
}

That will make the popup appear 200 px from the top of the page.

Bill
  • 25,119
  • 8
  • 94
  • 125