Sie sind nicht angemeldet.

1

Montag, 19. Mai 2014, 10:39

[SOLVED] Div overlay takes up full width issue

Hi

I have a div, called #panel, that is overlayed on top of the krpano. I've set a width and height on #panel, but a big black background, which is the same height as the #panel div, stretches the with of the page.

See the Div-over-pano.png attachment a screenshot of the problem

Here is my html code

Quellcode

1
2
3
<div id="panel">
    <p>Hello World</p>
</div>


and my CSS

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
#panel
{
    background: #ffffff;
    padding: 5px;
    width: 250px;
    height: 250px;
}

#panel p
{
    color: #000000;
}


UPDATE:

My div was pushing the pano down, hence the black background stretching the width of the screen.
Here is my updated CSS code that fixed the problem

Quellcode

1
2
3
4
5
6
7
8
9
#panel
{
    background: #fff;
    padding: 5px;
    width: 250px;
    height: 250px;
    position: absolute;
    z-index: 1;
}
»bjorntheart« hat folgendes Bild angehängt:
  • Div-over-pano.png

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »bjorntheart« (19. Mai 2014, 11:51)