A
A
Alfre2015-03-02 22:26:32
css
Alfre, 2015-03-02 22:26:32

How can I set the position so that when hovering over, block starts from the edge of the parent element, but overlaps the next element?

So, we have 12 buttons, 4 pieces are displayed on my screen.
1ca0c499626d4601b3671dbf72ec369a.png
Everyone has exactly the same code (excl. - names):

.name
{
    position:static;   
    width:auto;
    height:100px;
    background-color:#F1AE0B;
}

When you hover over the button, a block pops up:
69de113d24f944789e1827f471af7214.pngec087bc680634d27b5d42f1561750f75.png
And here is the block code (also the same for everyone):
.block
{
    position:absolute;
    width:auto;
    height:auto;
    left:0;
    top:0;
    right:0;
    background:rgba(255,255,255, 0.75);
    display:none;
}

The problem is that the block, no matter which button it is attached to, is always displayed at the beginning of the page, as a result of which, when we reach the last button, we cannot understand the text of the block, only part of it is visible at the top (to which we but we won’t get it, since the block is displayed when you hover over the button):
363fe7d7ac644a39a3623ff2041939f2.png
Is there a solution so that the block starts not from the beginning of the page, but from the top border of the button, that is, like this:
89f522c573e14dacab726aa991599b77.png
And at the same time, the block should overlap the bottom buttons.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Konyushevsky, 2015-03-02
@Alfre

jsfiddle.net/e0n6sey3/1 - like this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question